everyone 发表于 2007-6-20 09:47:15

鼠标后台点击问题

<p>版主,我想写一个模拟鼠标点击后台的程序的程序,也就是前台的鼠标不受到影响,而后台的程序还是被点击。</p><p>有什么办法可以实现这个功能?</p>

马大哈 发表于 2007-6-20 11:03:49

<p>这个就要看后台程序是否能接受SendMessage/PostMessage式的消息了</p><p>如果后台程序能够接受这样的消息,就不需要模拟鼠标</p><p>不然,还是得老实地模拟鼠标.......</p><p>这样就会影响正常的使用.</p>

everyone 发表于 2007-6-20 11:07:13

你发过一个是用PostMessage来模拟点击的。可以模拟点击后台按钮。但我想模拟点击后台某一处要怎么实现哪?

马大哈 发表于 2007-9-26 12:23:50

<p>MSDN里有说明:</p><p>WM_LBUTTONUP<br/>The WM_LBUTTONUP message is posted when the user releases 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. </p><p>WM_LBUTTONUP <br/>fwKeys = wParam;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // key flags <br/>xPos = LOWORD(lParam);&nbsp; // horizontal position of cursor <br/>yPos = HIWORD(lParam);&nbsp; // vertical position of cursor </p><p>那么,只需要在发送鼠标消息时按高低位,给出相应的坐标值就可以了.</p>
页: [1]
查看完整版本: 鼠标后台点击问题