2012年4月30日 星期一

vbnet 熱鍵 API

引用來源
--
這是屬單 form 的熱鍵,運用起來; 會比 form 內的 e.keycode 好用!


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

沒有留言:

張貼留言