WinGetPos gives on some win bad values

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review

Expand view Topic review: WinGetPos gives on some win bad values

Re: WinGetPos gives on some win bad values

Post by pneumatic » 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.

WinGetPos gives on some win bad values

Post by bobo8 » 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.