CenterWindow

Started by Farabi, May 20, 2007, 01:39:21 AM

Previous topic - Next topic

Farabi

Maybe you will need it.


.386
.model flat,stdcall
option casemap:none

.code

CenterWindows proc hWnd:dword,_width:dword,height:dword
LOCAL xs,ys:dword
LOCAL hxs,hys:dword

invoke GetSystemMetrics,SM_CXSCREEN
mov xs,eax
shr eax,1
mov hxs,eax
invoke GetSystemMetrics,SM_CYSCREEN
mov ys,eax
shr eax,1
mov hys,eax

mov eax,_width
shr eax,1
sub hxs,eax

mov eax,height
shr eax,1
sub hys,eax

invoke SetWindowPos,hWnd,HWND_NOTOPMOST,hxs,hys,_width,height,NULL

ret
CenterWindows endp
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"