如何在不涉及鼠标指针的情况下在x,y处触发单击事件? [英] How can you trigger click events at x,y without the mouse pointer being involved?
问题描述
当我在其他地方忙于使用鼠标时,我希望能够每秒单击一次屏幕左侧的按钮(x/y偏移).
我一直在使用user32.dll mouse_event,当我传递100/100的x/y时...它将click事件发送到指针所在的位置,而不是指针所在的位置.指定的x,y偏移量.难道我做错了什么?
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP,X,Y,0,0);
谢谢,
ts
tsfreaks
I want to be able to click a button (x/y offset) once a second on the left side of the screen while I'm busy using my mouse elsewhere. Is that possible?
I've been playing around with user32.dll mouse_event and when I pass in an x/y of 100,100... it sends the click event to where the pointer is instead of the specified x,y offset. Am I doing something wrong?
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
Thanks,
ts
tsfreaks
推荐答案
这可能不是解决您问题的方法,但可能会有所帮助,请尝试使用Button .PerformClick()和计时器
kaymaf
这篇关于如何在不涉及鼠标指针的情况下在x,y处触发单击事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!