Jump to content
Sign in to follow this  

x64 and WindowFromPonit

Recommended Posts


Can someone else please confirm there is a problem with WindowFromPoint running on x64 when compiled as x64. I'm getting the wrong window handles returned. Compiled as x86 the returns are correct. Just move the mouse around, as x86 you should get different window handles. As x64, not so much.

Next would be to determine if this is an AutoIt problem or a win32 API problem. Thanks in advance.

My test setup:

Win7 Ultimate x64



HotKeySet("{ESC}", "_Exit")

While 1
    $a = DllCall("user32.dll", "hwnd", "WindowFromPoint", "long", MouseGetPos(0), "long", MouseGetPos(1))
    $b = DllCall("user32.dll", "int", "GetWindowTextW", "hwnd", $a[0], "wstr", "", "int", 1024)
    ConsoleWrite($a[0] & " : " & $b[2] & @CRLF)

Func _Exit()

Share this post

Link to post
Share on other sites

Thanks, that's the same fix I came up with when playing around a bit more (and the same theory I had).

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this