#include once "window9.bi"

sub CenterWindow (ByVal hWnd As HWND) Export
	Dim wRect As RECT
	GetWindowRect(hWnd,@wRect)
	wRect.right   = wRect.right-wRect.left
	wRect.bottom  = wRect.bottom-wRect.top
	MoveWindow(hWnd,(GetSystemMetrics(0) Shr 1) - (wRect.right Shr 1),_
		(GetSystemMetrics(1) Shr 1) - (wRect.bottom Shr 1),_
		wRect.right, wRect.bottom, 1)
End Sub
