Login Register


[VB.Net] Add Hotkeys to your program filter_list
Author
Message
[VB.Net] Add Hotkeys to your program #1
hi guys this is a tutorial to add shortcut keys to your programs which work even if the program is not on top.

Step 1:

Start a new project.


Step 2:


Below Form1 add this:
Code:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer



Step 3:

Add a timer and double click it. in the timer's code add this:
Code:
Dim hotkey1 As String hotkey1 = GetAsyncKeyState(Keys.F2) If hotkey1 = True Then MsgBox("Hello you just activated the Hotkey!", MsgBoxStyle.Information) End If

Then set the timer's Enabled field to True and interval to 10 ( as low as possible but not 1 because can make double hotkey counted )

Replace MsgBox("Hello you just activated the Hotkey!", MsgBoxStyle.Information) with your code when the key is pressed.


Have a nice day Smile
(This post was last modified: 03-26-2011, 07:10 PM by Skullmeat.)
Pierce the life fibers with your drill.

Reply

RE: [VB.Net] Add Hotkeys to your program #2
Nice tut!!! Smile
I do like it!!!
Staff will never ever ask you for your personal information.
We know everything about you anyway.

Reply

RE: [VB.Net] Add Hotkeys to your program #3
Most of the time you don't need a Global Hotkey, so you can just give focus to a certain hidden control, and get keystrokes on that.
At other times this helps. Nice share. Smile
[Image: rytwG00.png]
Redcat Revolution!

Reply

RE: [VB.Net] Add Hotkeys to your program #4
options button?
Pierce the life fibers with your drill.

Reply

RE: [VB.Net] Add Hotkeys to your program #5
thanx for this , really helped me , but how to make the hotkey from the text , means

i m in textbox , i want put enter as hotkey , so it will press the Button1!
- asad3man

Reply

RE: [VB.Net] Add Hotkeys to your program #6
I am try thanks ........

Reply







Users browsing this thread: 1 Guest(s)