可能重複:
How to simulate Mouse Click in C#?使用後/ SendMessage函數做鼠標點擊不工作
我已經試過
Window = FindWindow(null, "untitled - Paint");
PostMessage(WindowToFind, WM_MOUSEMOVE, 0, location);
PostMessage(WindowToFind, WM_LBUTTONDOWN, ((int)Keys.LButton), location);
位置100 * 0x10000 + 100
爲100x100
等我懷疑這是不對的。我試過換((int)Keys.LButton)
與0
,沒有工作。我試着在lbuttondown
和lbuttonup
之間插入thread.sleep
(well postmessage應該等待沒有thread.sleep
但是無論如何)我使用0x0200
爲鼠標移動,0x0202
爲左按鈕常量。
不知道爲什麼它根本不起作用。
你嘗試過嗎? http://stackoverflow.com/questions/2416748/how-to-simulate-mouse-click-in-c –
需要窗口在前面,並實際點擊。即時通訊試圖模擬它。 (我剛剛閱讀代碼,沒有看到任何窗口的東西,所以我可能是不正確的)仍然,謝謝。 –