Is there a way to be able to press anywhere on the form and it will do something for each button you push instead of having to do it for each object on your form? Exaple: F1, F2.. ect to F9 they Keycodes are 112 to 120
They're called hotkeys. You usually can assign them in any menu interfacing in your IDE.
The F1 and shit make the menu's look fugly.. kthx
Quote from: Tass on November 14, 2005, 06:41 PM
The F1 and shit make the menu's look fugly.. kthx
Then custom-draw the menus or handle the windows message.
Then you can also stop being a jackass to people who try to help. kthx
You can create the menu item, and set its Visible property to false. I'm sure you can manage the rest on your own ;)
Awhile back I started making a program to get Global HotKeys, anyway I got as far as this (http://www.clananthrax.net/other/Global%20HotKeys.zip) then got bored of it.
Just made it check to see if the Form has focus or not. :)
I suppose this is what FrOzeN's project does, but if not, you could just go keylogger style and use a timer and this code to determine if F1 is pressed:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Timer1_Timer()
If KeyState(vbKeyF1) Then
'your function code
End If
End Sub
Private Function KeyState(Key As Long) As Boolean
If GetAsyncKeyState(Key) = &H8001 Then KeyState = True
End Function
Yeah, that's exactly what this program does.
I have a more advanced one which hooks onto the system and the keys get parsed to the program each time a key is pressed. This can work as a KeyLogger though it's excellent and extremely proficient for HotKey use aswell. Though it's unfinished and I'm not releasing yet.
QuoteI have a more advanced one which hooks onto the system and the keys get parsed to the program each time a key is pressed. This can work as a KeyLogger though it's excellent and extremely proficient for HotKey use aswell. Though it's unfinished and I'm not releasing yet.
you can get the same thing off pscode, I found it when looking for a more profficent way of making global hotkeys.
Yeah but I prefer writing my own code. :)
That's kind of like saying "I'm writing the connections for my bot.", then you replying "You can just use a open-source bot."
yeah but from the way he responded I don't think he cares :(