PDA

Click to See Complete Forum and Search --> : FindWindowEx


rsmall
Jun 6th, 2001, 10:07 AM
I'm trying to set the child window of an application active. The child window is a window of an application that I did not create. What is the proper syntax for the function? Here is my code....

Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function Putfocus Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long


Private Sub Command1_Click()
Dim InvApp As Inventor.Application
Dim Handle As Variant
Set InvApp = GetObject(, "Inventor.Application")
AppActivate InvApp.Caption, True
Handle = FindWindowEx(InvApp.MainFrameHWND, vbNullString, "#32270", vbNullString)
Putfocus (Handle)
End Sub


Thanks,

Ryan

Megatron
Jun 6th, 2001, 11:02 AM
hParent = FindWindowEx(0, 0, "ClassName", "Title")
hChild = FindwindowEx(hParent, 0, "ClassName", "Title"