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 

WinGetPos delivers hex values

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





PostPosted: Thu Sep 13, 2007 3:00 pm    Post subject: WinGetPos delivers hex values Reply with quote

Hi, I've checked the announcement section if what occurs to be a bug has been solved/fixed already. But it doesn't look so. Here we go.

I've created an AHK GUI. To 'dock' additional GUIs to the master GUI I use WinExist() to get it's handle (hex, OK) which I'll use later with a DllCall(). Afterwards I try to get the position of the window itself using WinGetPos.
What's confusing me - WinGetPos delivers (now?) X+Y as hex values too (can't find anything about that in the help). Therefore it needs me to do a conversion of that values, because the following GUI, x:Show's doesn't accept those hex values as x/y coordinates.

The whole code block is used within a function.

AHK 1.0.47.01
XP Pro SP2

Code:
GUICall(sessionID,LFMPath)
{   
   .
   .
   .

   Gui, Margin, 0,0
   Gui  +DisplayAlbumCover +LastFound -Caption +AlwaysOnTop +Border +ToolWindow
   Gui, Add, Picture, x0 y0 w130 h130, %AlbumCover%
   OnMessage(0x200, "WM_MOUSEMOVE")
   Gui, Show, AutoSize Hide, DisplayAlbumCover
   GUI_ID1:=WinExist("DisplayAlbumCover")   
   
   WinGetPos, GUI1X, GUI1Y, GUI1Width, GUI1Height, DisplayAlbumCover
   SetFormat, integer, d
   GUI1X      += 0
   GUI1Y      += 0
   GUI1Width   += 0
   GUI1Height   += 0
   DW         += 0
   
   Gui, 2:Margin, 0,0
   Gui, 2:Font,, Courier New   
   Gui  2:+DisplayArtist +LastFound -Caption +AlwaysOnTop +ToolWindow
   Gui, 2:Add, Text, xm+10, Artist:`t%ArtistName%
   Gui, 2:Show, % "x" . (GUI1X+GUI1Width) . " y" . (GUI1Y) . " w" . DW . " h24 Hide", DisplayArtist
   GUI_ID2:=WinExist("DisplayArtist")
   .
   .
   .

   }

To reproduce that behaviour I've created the following code snippet. With the result that WinGetPos delivered now decimal values Shocked Mad Crying or Very sad

Code:
!y:: ; press Alt+Y
CallWinGetPos()
Gui, Destroy
Return

CallWinGetPos()
{
Gui, +GUITest +LastFound -Caption +AlwaysOnTop +Border +ToolWindow
Gui,Add, Text,, Test
Gui, Show, Autosize, GUITest
GUI_ID1:=WinExist("GUITest")

WinGetPos, GX, GY, Width, Height, GUITest
MsgBox % Gx "`n" GY "`n" GUI_ID1
Return
}
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Sun Nov 11, 2007 10:36 pm    Post subject: Reply with quote

Sorry for the late reply. Since we can't yet reproduce it with a short script, is it possible that your big script has any usages of SetFormat, Integer, Hex that might be affecting the result?
Back to top
View user's profile Send private message Send e-mail
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