CenterWindow	PROC WinHandle:DWORD

	LOCAL Ano			:	RECT
	LOCAL ScreenWidth	: 	DWORD
	LOCAL ScreenHeight	: 	DWORD
	LOCAL DlgWidth		: 	DWORD
	LOCAL DlgHeight		: 	DWORD

	INVOKE GetSystemMetrics,SM_CXSCREEN
	MOV ScreenWidth,EAX

	INVOKE GetSystemMetrics,SM_CYSCREEN
	MOV ScreenHeight,EAX

	LEA EAX,Ano
	INVOKE GetWindowRect,WinHandle,EAX
	MOV EBX,[Ano.left]  
	MOV EAX,[Ano.right] 
	SUB EAX,EBX
	MOV DlgWidth,EAX

	MOV EBX,[Ano.top]
	MOV EAX,[Ano.bottom]
	SUB EAX,EBX
	MOV DlgHeight,EAX

	MOV EAX,ScreenWidth
	SHR EAX,1
	MOV EBX,DlgWidth
	SHR EBX,1
	SUB EAX,EBX

	PUSH EAX

	MOV EAX,ScreenHeight
	SHR EAX,1
	MOV EBX,DlgHeight
	SHR EBX,1
	SUB EAX,EBX
	
	POP EBX
	INVOKE MoveWindow,WinHandle,EBX,EAX,DlgWidth,DlgHeight,TRUE

	RET

CenterWindow	ENDP

