It takes a lot for me to give up on finding the solution and for this I've finally reached that point. I have a program that opens a few other programs (PowerPoint, Excel and mIRC) and runs each one inside a panel on the form. I'm having no issues with PowerPoint or mIRC. Excel was working for a bit and now just doesn't work. Here is my code:
I have a button on the form which launches LoadTracker.
Code:
Private Const WM_SYSCOMMAND As Integer = 274 Private Const SC_MAXIMIZED As Integer = 61488 Declare Auto Function SetParent Lib "user32.dll" (ByVal hWndChild as IntPtr, ByVal hWndNewParent As IntPtr) As Integer Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal IParam As Integer) As Integer Dim proc3 As System.Diagnostics.Process Private Sub LoadTracker() proc3 = System.Diagnostics.Process.Start(NameOfMyExcelFile) proc3.WaitForInputIdle() SetParent(proc3.MainWindowHandle, Me.TPanel.Handle) SendMessage(proc3.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0) End Sub
Comment