VB Code:
Declare Auto Function FindWindow Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr 'other stuff 'set WindowText to the window title eg. "Untitled - Notepad" SetParent(FindWindow(vbNullString, WindowText), Panel1.Handle)
You may need to tweak some stuff. vbNullString usually works but try the application name (minus extension) if it doesn't. I don't think it applies in this case but if the second window is already a child, you'll need to use FindWindowEx instead (it has a few extra parameters so look it up on MSDN and/or Pinvoke).




Reply With Quote