Valhalla Legends Forums Archive | Battle.net Bot Development | Quick Channels

AuthorMessageTime
Tass
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
November 14, 2005, 11:38 PM
Networks
They're called hotkeys. You usually can assign them in any menu interfacing in your IDE.
November 15, 2005, 12:17 AM
Tass
The F1 and shit make the menu's look fugly.. kthx
November 15, 2005, 12:41 AM
Myndfyr
[quote author=Tass link=topic=13236.msg133970#msg133970 date=1132015298]
The F1 and shit make the menu's look fugly.. kthx
[/quote]
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
November 15, 2005, 12:45 AM
Topaz
You can create the menu item, and set its Visible property to false. I'm sure you can manage the rest on your own ;)
November 15, 2005, 1:10 AM
FrOzeN
Awhile back I started making a program to get Global HotKeys, anyway I got as far as this then got bored of it.

Just made it check to see if the Form has focus or not. :)
November 15, 2005, 2:35 AM
l2k-Shadow
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:
[code]
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
[/code]
November 15, 2005, 3:07 AM
FrOzeN
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.
November 15, 2005, 4:27 AM
Forged
[quote]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.[/quote]
you can get the same thing off pscode, I found it when looking for a more profficent way of making global hotkeys.
November 15, 2005, 5:06 AM
FrOzeN
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."
November 15, 2005, 5:25 AM
Forged
yeah but from the way he responded I don't think he cares  :(
November 15, 2005, 6:23 AM

Search