05-24-2015, 05:11 PM
I often use either GetWinXY or DpiGetWindowRect to help me move the mouse cursor to the center of a window.
For some reason, I have to do it in two steps:
or
but these do not work:
just wondering why. Not a big deal but I want to make sure I understand if this is my misunderstanding of QM's syntax for functions/commands.
Thanks as always,
S
For some reason, I have to do it in two steps:
int w=win("Untitled - Notepad" "Notepad")
int x y cx cy x_mid y_mid
GetWinXY(w x y cx cy)
int x_mid(x+(cx*0.5)) y_mid(y+(cy*0.5))
mou x_mid y_mid
or
RECT r
DpiGetWindowRect w &r
x_mid = r.left+(0.5*(r.right-r.left))
y_mid = r.top+(0.5*(r.bottom-r.top))
mou x_mid y_mid
but these do not work:
mou x+(cx*0.5) y+(cy*0.5)
mou r.left+(0.5*(r.right-r.left)) r.top+(0.5*(r.bottom-r.top))
just wondering why. Not a big deal but I want to make sure I understand if this is my misunderstanding of QM's syntax for functions/commands.
Thanks as always,
S