[DllImport("user32.dll")]
static extern bool DestroyWindow(IntPtr hWnd);
Declare Function DestroyWindow Lib "user32.dll" (hWnd As IntPtr) As Boolean
hWnd is the pointer to the window you want to close/destroy. Create a new IntPtr object with the window's handle as a parameter to it's constructor. Make sure the pointers are in decimal, not in hex as spy++ gives them to you.
Please add some!
[DllImport("user32.dll")]
static extern bool DestroyWindow(IntPtr hWnd);
//Closes the form
btnCloseWindow_Click(object sender, EventArgs e)
{
DestroyWindow(this.Handle)
}
System.Windows.Forms.Form.Close