|
Trynew斑竹,以下为API32。CHM中对SendMessage,ReleaseCapture解释对照你的例子还是不明,请有空指点指点,谢谢
Declare Function SendMessage& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any)
说明
调用一个窗口的窗口函数,将一条消息发给那个窗口。除非消息处理完毕,否则该函数不会返回。SendMessageBynum, SendMessageByString是该函数的“类型安全”声明形式
返回值
Long,由具体的消息决定
参数表
参数 类型及说明
hwnd Long,要接收消息的那个窗口的句柄
wMsg Long,消息的标识符
wParam Long,具体取决于消息
lParam Any,具体取决于消息
Declare Function ReleaseCapture Lib "user32" Alias "ReleaseCapture" () As Long
说明
为当前的应用程序释放鼠标捕获
返回值
Long,TRUE(非零)表示成功,零表示失败
你是这样使用的:
Const WM_SYSCOMMAND As Long = &H112
Const SC_MOVE_MOUSE As Long = &HF012&
'To Simulate the Caption Move
Private Declare Function apiReleaseCapture Lib "user32" _
Alias "ReleaseCapture" () As Long
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Private Sub BarTitle_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
apiReleaseCapture
Call SendMessage(Me.Parent.hWnd, WM_SYSCOMMAND, SC_MOVE_MOUSE, 0)
End Sub
我的问题是:1.wMsg参数是不是可以自己乱取(消息的标识符 )?
2.wParam ,lParam 两参数该如何赋值?
3.能解释你对以上三个参数是如何赋值的吗?换句话就是为什么要
wMsg=&H112,wParam=&HF012&,lParam=0
4.ReleaseCapture在你的例子中起什么作用?
|
|