关于SetCursorPos和WM_SETCURSOR的问题 [英] Question about SetCursorPos and WM_SETCURSOR

查看:179
本文介绍了关于SetCursorPos和WM_SETCURSOR的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看这个例子:

SetCursorPos(posX, posY)
sendmessage(hwnd, wm_rbuttondown, &H2, makelparam(posX,posY))
sendmessage(hwnd, wm_rbuttonup, 0, makelparam(posX,posY))

鼠标移动到该位置然后单击,但是我想找到一种模拟鼠标移动以单击的方式:

The mouse move to the location then click, but i want to find a way to simulate the mouse move to click like:

sendmessage(hwnd, WM_SETCURSOR, hwnd, ?)
sendmessage(hwnd, wm_rbuttondown, &H2, makelparam(posX,posY))
sendmessage(hwnd, wm_rbuttonup, 0, makelparam(posX,posY))

推荐答案

鼠标移动到该位置然后单击,但是我想找到一种模拟鼠标移动以单击的方式:

The mouse move to the location then click, but i want to find a way to simulate the mouse move to click like:

sendmessage(hwnd, WM_SETCURSOR, hwnd, ?)
sendmessage(hwnd, wm_rbuttondown, &H2, makelparam(posX,posY))
sendmessage(hwnd, wm_rbuttonup, 0, makelparam(posX,posY))

您是说您不知道该消息应该使用什么lParam吗?

Are you saying that you don't know what lParam should be for that message?

lParam低位字是命中测试代码,由WM_NCHITTEST消息的返回值定义
lParam高位字是引起该消息的鼠标消息的编号.

lParam low word is a hit test code as defined by the return values of the WM_NCHITTEST message
lParam high word is the number of the mouse message that caused the message.

您可以在WIN32 API参考中轻松获得此信息-无需等待通过论坛进行的回复.

This information is readily available in your WIN32 API reference - there should be no need to wait for a response through the forums.


这篇关于关于SetCursorPos和WM_SETCURSOR的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆