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 

[solved] GetParent (dllcall) not finding some parent windows

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
evl



Joined: 24 Aug 2005
Posts: 1239

PostPosted: Thu Apr 10, 2008 3:43 am    Post subject: [solved] GetParent (dllcall) not finding some parent windows Reply with quote

Here's an example script that shows the active window's parent when you Press F1. Any ideas why it wouldn't find a parent for the Winamp v 2.81 playlist editor window when Windowse http://www.greatis.com/delphicb/windowse/ reports that there is one (as expected)?

Code:
F1::
DetectHiddenWindows, On
WinGet, wid, ID, A ; click in Winamp v2.81 playlist editor window first
Parent := Decimal_to_Hex( DllCall( "GetParent", "uint", wid ) )
msgbox, %Parent%
Return

Esc::exitapp

Decimal_to_Hex(var)
{
  SetFormat, integer, hex
  var += 0
  SetFormat, integer, d
  return var
}


Last edited by evl on Sun Apr 13, 2008 9:42 am; edited 1 time in total
Back to top
View user's profile Send private message
evl



Joined: 24 Aug 2005
Posts: 1239

PostPosted: Sun Apr 13, 2008 9:29 am    Post subject: Reply with quote

Well I found the solution: The window doesn't have a parent, it has an owner.

Code:
Owner := Decimal_to_Hex( DllCall( "GetWindow", "uint", wid , "uint", "4" ) ) ; GW_OWNER = 4
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help 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