I'm trying to make a Python 3 code that's open .exe program and get the program window x and y position every frame ( in a while )
my code so far:
from pywinauto import application
app = application.Application()
app.start("D:/GameMaker/Progects/Games/tut to next/GMnet-ENGINE-master/Builds/GMnetBaseTemplate/GMnetBaseTemplate.exe")
--
so how do I get the window's x and y positions? Thanks :D
Use window() to get application window, and call rectangle() method of base_wrapper class.
x = app.window().wrapper_object().rectangle().left
y = app.window().wrapper_object().rectangle().top
This also should work:
x = app.window().rectangle().left
y = app.window().rectangle().top