Imports System.Runtime.InteropServices
Public Class Form4
<DllImport("user32.dll", CharSet:=CharSet.Auto)> _
Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As UInt32, ByVal wParam As Integer, ByVal lParam As Integer) As IntPtr
End Function
<DllImport("user32.dll", SetLastError:=True)> _
Shared Function SetParent(ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
End Function
Private Const WM_SYSCOMMAND As Integer = &H112
Private Const SC_MINIMIZE As Integer = &HF020
Private Const SC_MAXIMIZE As Integer = &HF030
Private Sub Form4_Load(sender As Object, e As System.EventArgs) Handles Me.Load
'Dim panel As New Panel() With {.BorderStyle = BorderStyle.FixedSingle}
'Me.Controls.Add(panel)
'Arguments = "...",
Dim p As Process = Process.Start(New ProcessStartInfo() With {.FileName = String.Concat(Application.StartupPath, "\ReadMe.docx"), .WindowStyle = ProcessWindowStyle.Minimized})
System.Threading.Thread.Sleep(500)
Dim value As IntPtr = SetParent(p.MainWindowHandle, ExcelPanel.Handle)
SendMessage(p.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0)
End Sub
End Class
Imports System.Runtime.InteropServices
Public Class Form4
<DllImport("user32.dll", CharSet:=CharSet.Auto)> _
Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As UInt32, ByVal wParam As Integer, ByVal lParam As Integer) As IntPtr
End Function
<DllImport("user32.dll", SetLastError:=True)> _
Shared Function SetParent(ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
End Function
Private Const WM_SYSCOMMAND As Integer = &H112
Private Const SC_MINIMIZE As Integer = &HF020
Private Const SC_MAXIMIZE As Integer = &HF030
Private Sub Form4_Load(sender As Object, e As System.EventArgs) Handles Me.Load
'Dim panel As New Panel() With {.BorderStyle = BorderStyle.FixedSingle}
'Me.Controls.Add(panel)
'Arguments = "...",
Dim p As Process = Process.Start(New ProcessStartInfo() With {.FileName = String.Concat(Application.StartupPath, "\ReadMe.docx"), .WindowStyle = ProcessWindowStyle.Minimized})
System.Threading.Thread.Sleep(500)
Dim value As IntPtr = SetParent(p.MainWindowHandle, ExcelPanel.Handle)
SendMessage(p.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0)
End Sub
End Class