鼠标后台点击问题
<p>版主,我想写一个模拟鼠标点击后台的程序的程序,也就是前台的鼠标不受到影响,而后台的程序还是被点击。</p><p>有什么办法可以实现这个功能?</p> <p>这个就要看后台程序是否能接受SendMessage/PostMessage式的消息了</p><p>如果后台程序能够接受这样的消息,就不需要模拟鼠标</p><p>不然,还是得老实地模拟鼠标.......</p><p>这样就会影响正常的使用.</p> 你发过一个是用PostMessage来模拟点击的。可以模拟点击后台按钮。但我想模拟点击后台某一处要怎么实现哪? <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; // key flags <br/>xPos = LOWORD(lParam); // horizontal position of cursor <br/>yPos = HIWORD(lParam); // vertical position of cursor </p><p>那么,只需要在发送鼠标消息时按高低位,给出相应的坐标值就可以了.</p>
页:
[1]