473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Trying to SendKeys when someone presses "F" with VB08

I was experimenting around and tried to make it so that if someone presses the F key on their keyboard it also sends the rest of the letters to complete F*** anytime someone presses that letter... I know it's cruel but I just want to mess around with my friend and send it to him, hahaha... I know that the 32 to 128 is wrong, but I dont know what the # for F is.... It's probably more messed up than just that so someone please help me!


Expand|Select|Wrap|Line Numbers
  1. Public Class Form1
  2.     Private Declare Function GetKeyState Lib "user32" (ByVal vKey As Integer) As Integer
  3.     Dim Result As Integer
  4.     Dim i As Double
  5.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  6.         For i = 32 To 128
  7.             Result = GetKeyState(i)
  8.             If Result = -32767 Then
  9.                 SendKeys.Send("UCK")
  10.             End If
  11.         Next i
  12.     End Sub
  13. End Class
Jan 31 '08 #1
1 1276
Killer42
8,435 Expert 8TB
If you want to know the code for "F", you can either look it up in the doco, or ask VB. Do a KeyDown or KeyPress event procedure, and tell it to display the value. Then run the form, and see what is displayed.

I don't know which value you'd need, because I don't know whether that API call requires an ASCII code or keycode.
Feb 1 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Nuno | last post by:
Is there any SQL Error? Or I have to use Select case in VB code to control SQL instead. Thank you for any ans. Nuno
3
by: Phil | last post by:
Hi everybody, I am a XSLT beginner and the following problem really makes me crazy ! I have a main "contacts.xml" document which contains references to several contact data XML files. My aim...
2
by: Carl | last post by:
Hi, I tried to print a document with the window.print method, but with netscape 7, i always get the error:"the page was replaced while you was trying to print. Try again". I see "mydoc.htm" and...
8
by: Ayende Rahien | last post by:
I've a really strange problem, in some part of my code I compare two strings (through object), and while I *know* that they equal each other, and in the watch window they do equal each other, then...
9
by: Maksim Kasimov | last post by:
Hello, my programm sometime gives "Segmentation fault" message (no matter how long the programm had run (1 day or 2 weeks). And there is nothing in log-files that can points the problem. My...
0
by: Davis Ming | last post by:
Hi All, I used Microsoft Liner (7.00.9210) with makefile to compile an existing project. It works well until I add "/PDBSTRIPPED" option in order to get public symbol files. The error message is...
11
by: comp.lang.php | last post by:
function blah($item) { if (!isset($baseDir)) { static $baseDir = ''; $baseDir = $item; print_r("baseDir = $baseDir\n"); } $dirID = opendir($item); while (($fyl = readdir($dirID)) !== false)...
2
by: Ed Staffin | last post by:
In Internet Explorer under the tools/internet options menu on the general tab, there is a settings button under Temporary internet files. In there the user can specify when to "Check for newer...
3
by: Tea Maker | last post by:
Hi, I was wondering if there's a way to call a function when a user presses on the "back" or "forward" buttons of the browsers. What I want is, redirect the user to a new website (let's say...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.