[DllImport("user32.dll")]
static extern bool CloseWindow(IntPtr hWnd);
<DllImport("user32.dll", SetLastError:=True)> _
Private Shared Function CloseWindow(ByVal hWnd As IntPtr) As Integer
Private Declare Function CloseWindow Lib "user32" (ByVal Hwnd As IntPtr) As Boolean
None.
The CloseWindow function minimizes (but does not destroy) the specified window.
To destroy a window, an application must use the DestroyWindow function.
Please add some!
[Visual Basic.NET]
CloseWindow(Me.Object.Handle)
[C#.NET]
// Close the foreground window
CloseWindow(GetForeGroundWindow());
this should be CloseWindow(this.Handle);
You can use the WindowState property of the Form class and set this to FormWindowState.Minimized.