WinGetPos gives on some win bad values

Report problems with documented functionality
bobo8
Posts: 2
Joined: 15 Dec 2015, 08:40

WinGetPos gives on some win bad values

08 Mar 2018, 06:41

Hi, the WinGetPos gives bad values on some windows whilst the Windows Spy gives correct values. I have happened to meet such windows a few times, now I remember only 2 - X1.exe (paid SW) and MyPhoneExplorer portable, for example:
Windows Spy x: 322 y: 193 w: 1024 h: 1061
WinGetPos 1170, 194, 29, 29

I have tried WinGetPosEx (I found it on the forum) and "DetectHiddenWindows, on".
And the WinMove doesn't work with this windows.

I use updated AHK 64 bit, but this problem I have seen maybe for 10 years.
I am average user (only 10 000 AHK lines).
pneumatic
Posts: 338
Joined: 05 Dec 2016, 01:51

Re: WinGetPos gives on some win bad values

08 Mar 2018, 21:32

Try using a different WinTitle (ahk_idvs ahk_pidvs ahk_exevs Title). Sometimes they will give a different value because a different windows API function is being used to retrieve it, and the windows API is very difficult and convoluted to know under what circumstances exactly which values will be retrieved. Had a similar issue where ahk_exe was retrieiving a path with an extra ".\" in the string, but Process, Exist or DllCall("QueryFullProcessImageName") was not, but only for some processes.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 24 guests