Dim exeName As String = "exe文件的全路径"
Dim appwin As IntPtr
Dim Process As Process
Try
Process = System.Diagnostics.Process.Start(exeName)
Process.WaitForInputIdle()
appwin = Process.MainWindowHandle
System.Threading.Thread.Sleep(100)
Catch ex As Exception
MessageBox.Show(Me, ex.Message, "Error")
End Try
SetParent(appwin, Me.panelForm.Handle)
MoveWindow(appwin, 0, 0, Me.Width, Me.Height, True)
Dim appwin As IntPtr
Dim Process As Process
Try
Process = System.Diagnostics.Process.Start(exeName)
Process.WaitForInputIdle()
appwin = Process.MainWindowHandle
System.Threading.Thread.Sleep(100)
Catch ex As Exception
MessageBox.Show(Me, ex.Message, "Error")
End Try
SetParent(appwin, Me.panelForm.Handle)
MoveWindow(appwin, 0, 0, Me.Width, Me.Height, True)