AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Wrong hWnd in WinGet hWnd, ID, ,%v_WindowTitle%

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
BergerW



Joined: 05 Nov 2007
Posts: 1

PostPosted: Mon Nov 05, 2007 4:14 pm    Post subject: Wrong hWnd in WinGet hWnd, ID, ,%v_WindowTitle% Reply with quote

I'm using the statements

WinGet hWnd, ID, ,%v_WindowTitle%
and
ControlGet, v_hWnd, hWnd,, Internet Explorer_Server1,%v_WindowTitle%
in a script which runs all the times. I discovered that the returned hWnd is sometimes filled with ff to form a 64 bit address like 0xffffffff8f301e0 instead of 0x8f301e0.

A simple statement in the form
StringReplace, hWnd, hWnd, ffffffff
could solve the problem. I could see this on a Win XP System which is already cpu bounded by other jobs and it can happen at the start of the script or after hours.

Has somebody else made this experience in version 1.0.47 .04 or is this a bug?
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2397

PostPosted: Thu Nov 08, 2007 7:35 am    Post subject: Reply with quote

Do you have a small test script that you could post that can reproduce the issue?
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Sat Nov 10, 2007 2:19 am    Post subject: Re: Wrong hWnd in WinGet hWnd, ID, ,%v_WindowTitle% Reply with quote

BergerW wrote:
I discovered that the returned hWnd is sometimes filled with ff to form a 64 bit address like 0xffffffff8f301e0 instead of 0x8f301e0.

...are you using a 64-bit OS???...I have no idea if AutoHotkey can even run on a 64-bit OS...but if it can...I'm sure it's not expecting to...so if you are on a 64-bit OS & AutoHotkey is running (perhaps with a 32-bit compat wrapper)...then that would probably be the source...I'm sure AutoHotkey is not expecting to be on 64-bit...perhaps you can try WinGet'ing on some 64-bit processes & 32-bit processes & see if you can make it happen more reliably...or perhaps just something like masking the ids with 32-bit will make it stop giving 64-bit's...(or the StringReplace thing)...but also, this may be an obvious question...but do the 64-bit hwnds work?...like get the id & try WinMove on it...if Windows gives you a 64-bit id, I would expect it to work...but I also kinda assume something wasn't working or you wouldn't've posted...or maybe you just noticed they looked strange...

This DON'T work...(cept for the StringReplace)...can some math wiz tell me why the masking (&) / bit shifting (<<) don't work...

Code:
SetFormat, Integer, H

;//Your number was one byte/bit less than 64-bit...
64bit_id:=0xffffffff08f301e0

StringReplace, 32bit_id_strrep, 64bit_id, ffffffff

;//32bit_id:=64bit_id & 0xffffffff
32bit_id:=64bit_id
32bit_id_and:=32bit_id & 0xffffffff
32bit_id_lshft32:=32bit_id << 32
;//32bit_id:=1 >> 63

msgbox,
(LTrim
   64bit_id(%64bit_id%)
   32bit_id_strrep(%32bit_id_strrep%)
   32bit_id_and(%32bit_id_and%)
   32bit_id_lshft32(%32bit_id_lshft32%)
)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group