-
im having the same problem as steve.
i can get the coordinates of the window i want with GetWindowRect, and then i can easily put my form to where i want it to be on the window by using SetWindowPos.
BUT
when i make that window be my form's parent by using SetParent, it just wont go where i want it to go!!
Any ideas???
-
I believe this is what you want.
Use FindWindow and SetParent apis to find another Window and put it in your form.
Code:
Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal
hWndNewParent As Long) As Long
Declare Function findwindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal
hWndNewParent As Long) As Long
'Open up the calculator and try this:
'This will put the calculator in your form
Dim x
x = FindWindow(vbNullString, "Calculator")
If x = 0 Then
MsgBox "Window was not found!", 16
Else
SetParent x, Me.hWnd
End If