View Single Post
Old 06-11-2009, 13:59   #4
MarcoGG
Senior Member
 
L'Avatar di MarcoGG
 
Iscritto dal: Dec 2004
Messaggi: 3210
Ci sono diversi metodi per farlo, ma avrai bisogno di fare riferimento diretto ad alcune librerie API, ad esempio in questo modo :

> Dichiarazioni API necessarie :

Codice:
    Private Const WM_SYSCOMMAND As Integer = 274
    Private Const SC_MAXIMIZE As Integer = 61488
    Private Declare Auto Function SetParent Lib "user32.dll" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As Integer
    Private Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
> Apertura Word in Form :

Codice:
        Dim P As Process = Process.Start("winword.exe")
        P.WaitForInputIdle()
        SetParent(P.MainWindowHandle, Me.Handle)
        SendMessage(P.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0)
MarcoGG è offline   Rispondi citando il messaggio o parte di esso