Advertisement
Guest User

MDI Form

a guest
Dec 22nd, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. Public Class Form1
  2. Inherits System.Windows.Forms.Form
  3. Declare Function ShowWindow Lib "user32" (ByVal hWnd As System.IntPtr, ByVal nCmdShow As Integer) As Boolean
  4. Private Const SW_MINIMIZE As Integer = 6
  5. Private Const SW_MAXIMIZE As Integer = 3 'By Ahmed Salah =D
  6. Private Const SW_RESTORE As Integer = 9
  7.  
  8. Declare Function SetParent Lib "user32" (ByVal hWndChild As System.IntPtr, ByVal hWndNewParent As System.IntPtr) As System.IntPtr
  9.  
  10. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  11. Dim p As Process = System.Diagnostics.Process.Start("C:\Windows\notepad.exe") 'By Ahmed Salah =D
  12. p.WaitForInputIdle()
  13. SetParent(p.MainWindowHandle, Me.Handle) 'By Ahmed Salah =D
  14. ShowWindow(p.MainWindowHandle, SW_MAXIMIZE)
  15. End Sub
  16. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement