delphi如何模拟鼠标滚轮的往上和往下
如何模拟鼠标滚轮往上往下的操作Sendmessage(Handle,WM_MOUSEWHEEL,wParam,LPARAM);网上找了一段不知道怎么模拟往下和往上的操作求...
如何模拟鼠标滚轮往上 往下的操作
Sendmessage(Handle,WM_MOUSEWHEEL,wParam,LPARAM);
网上找了一段 不知道怎么模拟往下 和往上 的操作 求解答 展开
Sendmessage(Handle,WM_MOUSEWHEEL,wParam,LPARAM);
网上找了一段 不知道怎么模拟往下 和往上 的操作 求解答 展开
1个回答
展开全部
Handle是要实现鼠标滚动的窗口句柄.
知道句柄直接使用SendMessage发消息给窗口就行了
句柄可以用FindWindow这个API函数获得
知道句柄直接使用SendMessage发消息给窗口就行了
句柄可以用FindWindow这个API函数获得
追问
知道句柄直接使用SendMessage发消息给窗口就行了
发送消息的内容是??
Sendmessage(Handle,WM_MOUSEWHEEL,wParam,LPARAM);
后面的2个参数怎么写 怎么判断是往上 还是往下 ??
追答
可以查看MSDN或Delphi帮助文档
wParam
The high-order word indicates the distance the wheel is rotated, expressed in multiples or divisions of WHEEL_DELTA, which is 120. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user.
The low-order word indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
lParam
The low-order word specifies the x-coordinate of the pointer, relative to the upper-left corner of the screen.
The high-order word specifies the y-coordinate of the pointer, relative to the upper-left corner of the screen.
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询