The import win32api
The import win32gui
The import win32con
Def click_it (HWND, pos) :
Client_pos=win32gui. ScreenToClient (handle, pos)
TMP=win32api. MAKELONG (client_pos [0], client_pos [1])
Win32gui. SendMessage (HWND, win32con. WM_ACTIVATE, win32con WA_ACTIVE, 0)
Win32gui. SendMessage (HWND, win32con WM_MOUSEMOVE, None, TMP)
Win32gui. SendMessage (HWND, win32con. WM_LBUTTONDOWN, win32con MK_LBUTTON, TMP)
Win32gui. SendMessage (HWND, win32con. WM_LBUTTONUP, win32con MK_LBUTTON, TMP)
Click_it (f, (209877))
I need to click on the game
Using spy++ view when the mouse didn't click on the game will automatically generate WM_MOUSEMOVE WM_SETCURSOR (such as images)
Don't know whether this problem can cause can't click any solution for
CodePudding user response:
Get the window handle to confirm right? Try to modify title or moving window position effective?CodePudding user response: