January 1, 2005

WinTask - GetParent

'
' GetParent
'
' Author: Joe Strazzere
'

' "user32" Alias "GetParent" (ByVal hwnd As Long) As Long
'

shell("notepad")
UseWindow("NOTEPAD.EXE|Edit|Untitled - Notepad|1",1)
SendKeys("<F3>")
hwnd=GetWindowHandle("NOTEPAD.EXE|Button|Cancel",1)
a = External("user32","GetParent", hWnd)
msgbox("The handle of the Parent of the Cancel Button is : "+Str$(a),,"GetParent")
msgbox("The 'name' of the Parent of the Cancel Button is : "+GetWindowName(a))

hwnd=GetWindowHandle("NOTEPAD.EXE|#32770|Find")
a = External("user32","GetParent", hWnd)
msgbox("The handle of the Parent of the Find dialog is : "+Str$(a),,"GetParent")
msgbox("The 'name' of the Parent of the Find dialog is : "+GetWindowName(a))
SendKeys("<Esc><Alt>fxn")