vb.net winform在panel中打开exe文件

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)


你可能感兴趣的:(WinForm)