News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

A helper routine for WM_SIZE message handlers

Started by Larry Hammick, November 30, 2009, 01:24:45 AM

Previous topic - Next topic

jj2007

Quote from: Larry Hammick on December 01, 2009, 08:45:11 AM

WindowClientSize:  ;eax=hWnd, returns eax=client height, edx=client width, and ecx=0
    sub esp,10h
    mov ecx,esp
    invoke GetClientRect,eax,ecx
    pop eax   ;zero
    pop ecx   ;zero
    pop edx
    pop eax
    ret


Hutch, I would suggest going for size. GetClientRect in an innermost loop...?
Right now it's 17 bytes, without the mov ecx, esp it's 15, just under one para. Great little routine :thumbu

hutch--

JJ,

here is how to wase the space, put an "align 16" in front of the label.  :bg
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php