[求助]设置窗体快捷键只用sendMessage就可以了吗?
在书上看了段代码,其为设置窗体快捷键,其中只用到了sendMessage 这个WIN32 API函数,但是按照书上的代码感觉上并没有设置好快捷键,是不是还需要什么设置呢? 比如说键盘监听。。。。
书上主要代码如下:
Private Type tInteger
aint As Integer
End Type
Private Type t2Byte
lByte As Byte
hByte As Byte
End Type
Private ii As tInteger
Private bb As t2Byte
Private Sub Command1_Click()
Dim wParam As Long, I As Long
bb.hByte = MOD_CONTROL Or MOD_SHIFT
bb.lByte = vbKeyT
LSet ii = bb
wParam = CLng(ii.aint)
I = SendMessage(Me.hwnd, WM_SETHOTKEY, wParam, 0)
End Sub