WinGet, OutputVar, ID returns uint64 as hwnd, like 0xffffffff80400b6c

Report problems with documented functionality
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

WinGet, OutputVar, ID returns uint64 as hwnd, like 0xffffffff80400b6c

Post by malcev » 30 May 2021, 19:52

Code: Select all

WinGet, OutputVar, ID
sometimes returns uint64 as hwnd.
But hwnd should be in 32 bit range.
https://docs.microsoft.com/en-us/windows/win32/winprog64/interprocess-communication?redirectedfrom=MSDN
When I get such hwnd := 0xffffffff80400b6c and try to use it with AccessibleObjectFromWindow, I cannot receive iaccessible interface.
To fix it I have to do

Code: Select all

varsetcapacity(var, 8, 0)
numput(hwnd, var, 0, "uint64")
hwnd := numget(var, 0, "uint")
Here is written that it is because of sign extension.
https://stackoverflow.com/questions/43012454/is-it-normal-for-an-hwnd-to-have-its-high-bit-set
It would be good to fix it in ahk source code


Locked

Return to “Bug Reports”