I want to embedd certain software into my VB.NET apps to better display opened files and even do things like embedd chrome/firefox into the form. With this code I have managed to dock notepad.exe into the form, but when I switch to something like Firefox or most any other program it does not work.
Imports System.Diagnostics
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("user32.dll")> Public Shared Function SetParent(ByVal hwndChild As IntPtr, ByVal hwndNewParent As IntPtr) As Integer
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Process1.StartInfo.FileName = ("notepad.exe")
Process1.Start()
'The next lines will temporarily freeze the application
Do Until Process1.WaitForInputIdle = True
'Nothing
Loop
SetParent(Process1.MainWindowHandle, Panel1.Handle)
End Sub
End Class
Any input on how to get a handle on the process and dock it?