Hello 2 all.
Another newbie on the block.
I have seen a lot ways to implement your Wndproc function.
But i kinda a like the style below.
My question is does this create to much overhead ( is it bad coding this way ).
Because of the stack frame creation in every message call.
And aslo saving regs in each Message call
And how wil you do it (example please ).
Than you verry much.
WndProc:
cmp dword [esp+8],WM_DESTROY
je ON_DESTROY
cmp dword [esp+8],WM_CREATE
je ON_CREATE
cmp dword [esp+8],WM_TIMER
je ON_TIMER
jmp DEFWIN
proc ON_DESTROY,hWnd,uMsg,wParam,lParam
invoke KillTimer,[hWnd],1
invoke PostQuitMessage,0
return
endp
proc ON_CREATE,hWnd,uMsg,wParam,lParam
push edi esi ebx
invoke SetTimer,[hWnd],1,2000,0
pop ebx esi edi
return
endp
proc ON_TIMER,hWnd,uMsg,wParam,lParam
push edi esi ebx
invoke SendMessage,[hWnd],WM_CLOSE,0,0
pop ebx esi edi
return
endp
proc DEFWIN,hWnd,uMsg,wParam,lParam
push edi esi ebx
invoke DefWindowProc,[hWnd],[uMsg],[wParam],[lParam]
pop ebx esi edi
return
endp