两个API来的. Private Declare Function RegisterHotKey Lib "user32" _ (ByVal hWnd As Long, _ ByVal id As Long, _ ByVal fskey_Modifiers As Long, _ ByVal vk As Long) As LongPrivate Declare Function UnregisterHotKey Lib "user32" _ (ByVal hWnd As Long, ByVal id As Long) As Long
UnregisterHotKey F.hWnd, uVirtkey
这两句调换位置
两个API来的.
Private Declare Function RegisterHotKey Lib "user32" _
(ByVal hWnd As Long, _
ByVal id As Long, _
ByVal fskey_Modifiers As Long, _
ByVal vk As Long) As LongPrivate Declare Function UnregisterHotKey Lib "user32" _
(ByVal hWnd As Long, ByVal id As Long) As Long
UnregisterHotKey F.hWnd, uVirtkey调换位置还是出错了!
……
'代替WINDOWS原地址
OldFunPtr=SetWindowLong(F.hWnd, GWL_WNDPROC, AddressOf Wndproc)
'SET HOTKEY
idHotkey = 1
……
End Sub
'退出时用了
Function Unhotkey()
UnregisterHotKey frmSend.hWnd, idHotkey
Call SetWindowLong(F.hWnd, GWL_WNDPROC, OldFunPtr)
End Function