Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27059

VS 2010 About Formularios MDI, An Idea That I Had Recently!

$
0
0
Code:

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 lParam As Integer) As Integer
    Private Const WM_SYSCOMMAND As Integer = 274
    Private Const SC_MAXIMIZE As Integer = 61488
    Dim proc As Process

    Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label5.Click
        proc = Process.Start("CAMINHO")
        proc.WaitForInputIdle()

        SetParent(proc.MainWindowHandle, Panel1.Handle)
        SendMessage(proc.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0)
        'End If
    End Sub

I use this code to insert an external application as MDI in my form, but I wanted to know how to do the opposite ... Leave my FORM within an application, how do I?

Viewing all articles
Browse latest Browse all 27059

Trending Articles