Option Explicit
'Константы
Public Const SW_HIDE = 0
Public Const SW_SHOWNORMAL = 1
Public Const SW_SHOWMINIMIZED = 2
Public Const SW_SHOWMAXIMIZED = 3

'Типы
Public Type RECT
			Left As Long
			Top As Long
			Right As Long
			Bottom As Long
End Type

'Функции
Public Declare Function GetActiveWindow Lib "user32" () As Long

Public Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, _
			lpRect As RECT) As Long

Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
			(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
			(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
			ByVal nCmdShow As Long) As Long

Public Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" _
			(ByVal hwnd As Long, ByVal lpString As String) As Long

Пример 6.1.
Закрыть окно