Python
- 1 ответ
- 0 вопросов
0
Вклад в тег
import win32gui
import win32api
import win32con
import time
#import pyautogui
def click(x,y):
hWnd = win32gui.FindWindow("Notepad", None)
#print(str(hWnd))
childHWND = win32gui.FindWindowEx(hWnd, None, "Edit", None)
#print(str(childHWND))
lParam = win32api.MAKELONG(x, y)
#клик
win32api.SendMessage(childHWND, win32con.WM_LBUTTONDOWN, win32con.MK_LBUTTON, lParam)
win32api.SendMessage(childHWND, win32con.WM_LBUTTONUP, win32con.MK_LBUTTON, lParam)
time.sleep(1)
temp = win32api.PostMessage(childHWND, win32con.WM_CHAR, 0x44, 0) #пишет букву
click(50,50)