关键字:API & 高分 & 在线等待
1 用postmessage发送鼠标down & up 信息,参数应如何写?
2 用sendmessage又该如何?
谢谢!!!
问题点数:100、回复次数:13Top
1 楼wgku(云霄)回复于 2002-05-05 20:11:12 得分 10
到这里看看吧:)
http://www.csdn.net/expert/topic/533/533187.xml?temp=.4342768Top
2 楼water_j(随心所欲)回复于 2002-05-05 20:14:04 得分 10
PostMessage hWnd,MOUSEEVENTF_RIGHTDOWN, 0&, 0&(右键下)
PostMessage hWnd,MOUSEEVENTF_RIGHTUP, 0&, 0&(左键上)
Top
3 楼uv2000()回复于 2002-05-05 20:19:04 得分 0
我这样试过:
a=PostMessage ( hWnd,MOUSEEVENTF_RIGHTDOWN, 0&, 0&)
虽然结果a = 1
但无鼠标点击事件发生,有人说此代码要加上鼠标的坐标为形参。
还有人说在vc下可调试通过,在vb下不行!!!Top
4 楼zyl910(编程的乐趣在于编程控制硬件,与用图形学实现绚丽效果)回复于 2002-05-05 20:22:16 得分 0
鼠标消息常数:
Private Const WM_MOUSEMOVE = &H200
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202
Private Const WM_LBUTTONDBLCLK = &H203
Private Const WM_RBUTTONDOWN = &H204
Private Const WM_RBUTTONUP = &H205
Private Const WM_RBUTTONDBLCLK = &H206
Private Const WM_MBUTTONDOWN = &H207
Private Const WM_MBUTTONUP = &H208
Private Const WM_MBUTTONDBLCLK = &H209
Private Const WM_NCMOUSEMOVE = &HA0
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const WM_NCLBUTTONUP = &HA2
Private Const WM_NCLBUTTONDBLCLK = &HA3
Private Const WM_NCRBUTTONDOWN = &HA4
Private Const WM_NCRBUTTONUP = &HA5
Private Const WM_NCRBUTTONDBLCLK = &HA6
Private Const WM_NCMBUTTONDOWN = &HA7
Private Const WM_NCMBUTTONUP = &HA8
Private Const WM_NCMBUTTONDBLCLK = &HA9
Top
5 楼zyl910(编程的乐趣在于编程控制硬件,与用图形学实现绚丽效果)回复于 2002-05-05 20:24:22 得分 0
键盘状态=wParam
X=lParam And &HFFFF&
Y=(lParam And &HFFFF0000)\&H10000Top
6 楼uv2000()回复于 2002-05-05 20:28:02 得分 0
是这样写么:
Private Const WM_LBUTTONDOWN = &H201
X=lParam And &HFFFF&
Y=(lParam And &HFFFF0000)\&H10000
a = postmessage(hwand,WM_LBUTTONDOWN ,x,y)Top
7 楼zyl910(编程的乐趣在于编程控制硬件,与用图形学实现绚丽效果)回复于 2002-05-05 20:31:27 得分 0
MSDN:
WM_LBUTTONDOWN
The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
WM_LBUTTONDOWN
fwKeys = wParam; // key flags
xPos = LOWORD(lParam); // horizontal position of cursor
yPos = HIWORD(lParam); // vertical position of cursor
Parameters
fwKeys
Value of wParam. Indicates whether various virtual keys are down. This parameter can be any combination of the following values: Value Description
MK_CONTROL Set if the ctrl key is down.
MK_LBUTTON Set if the left mouse button is down.
MK_MBUTTON Set if the middle mouse button is down.
MK_RBUTTON Set if the right mouse button is down.
MK_SHIFT Set if the shift key is down.
xPos
Value of the low-order word of lParam. Specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
yPos
Value of the high-order word of lParam. Specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return Values
If an application processes this message, it should return zero.
Remarks
An application can use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winuser.h.
See Also
Mouse Input Overview, Mouse Input Messages, GetCapture,MAKEPOINTS,POINTS, SetCapture, WM_LBUTTONDBLCLK, WM_LBUTTONUPTop
8 楼zyl910(编程的乐趣在于编程控制硬件,与用图形学实现绚丽效果)回复于 2002-05-05 20:34:12 得分 0
a = postmessage(hwand,WM_LBUTTONDOWN , 0, (x And &hFFFF)+(y And &HFFFF)*&H10000)Top
9 楼uv2000()回复于 2002-05-05 20:39:41 得分 0
我试一下,如果可以马上给分,还有补充吗?????
我再等一会!!!!Top
10 楼uv2000()回复于 2002-05-05 20:46:20 得分 0
????Top
11 楼uv2000()回复于 2002-05-05 20:50:37 得分 0
????Top
12 楼zyl910(编程的乐趣在于编程控制硬件,与用图形学实现绚丽效果)回复于 2002-05-05 20:50:41 得分 80
除非你又遇到了问题Top
13 楼uv2000()回复于 2002-05-05 20:55:51 得分 0
thanks a lotTop
相关问题
- 关键字:button mouseclicked 在线等待
- 关键字:控件 注册表 方法 在线等待……
- 关键字:事件 TextArea Button 在线等待……
- 带select case关键字的select语句怎样写,在线等待!
- 求修改表中主关键字的SQL语句,在线等待!
- 很急,在线等待!!谁能帮我写一段:table1 关键字t, table2关键字t。当table1插入记录到table2中时,如果table2中关键字值有重复则覆盖
- 各位高手,请问如何更新一条记录的关键字,急,在线等待
- 救命!为什么出现此错误“常见错误 不能打开注册表关键字 ”在线等待!
- 无唯一关键字的表如何实现分页查询?(在线等待,急急急)
- SOS!!!菜鸟急求!!!在VB中哪个关键字创建新对象?在线等待!!




