I have an clicker script and it's working well for working with cursor
but I want this :
1-my cursor WON'T move
2-the script will click on my coordinates
import time
import win32gui
import win32api
import win32con
wdname = 'myexe'
hwnd = win32gui.FindWindow(None, wdname) # parent handle
print(hwnd)
def control_click(x, y, handle, button):
l_param = win32api.MAKELONG(x, y)
if button == 'left':
win32gui.PostMessage(handle, win32con.WM_LBUTTONDOWN, win32con.MK_LBUTTON, l_param)
win32gui.PostMessage(handle, win32con.WM_LBUTTONUP, win32con.MK_LBUTTON, l_param)
elif button == 'right':
win32gui.PostMessage(handle, win32con.WM_RBUTTONDOWN, 0, l_param)
win32gui.PostMessage(handle, win32con.WM_RBUTTONUP, 0, l_param)
control_click(x, y, 1769574, button ='left')
that is my code hope u will help :)
source https://stackoverflow.com/questions/74829528/i-want-to-click-to-spesific-location-on-minimized-window
Comments
Post a Comment