hi all,
i was not sure what to put in the subject but what i want to do is something like this:
MyProc proc lpBuffer:DWORD, Parm2:DWORD, Parm3:DWORD

invoke SubCall, lpBuffer

MyProc endp

SubCall proc lpBuffer:DWORD

invoke FindWindow, addr szMyWindowClass, NULL
.if eax == 0 ;window not found!
invoke lstrcpy, lpBuffer, addr szErrorMsg ;put error message in buffer
ret ?? ;here i want to exit SubCall and MyProc. so im back at the caller that called MyProc.

ret ;window was found.. just exit SubCall
SubCall endp
i hope you understand what im trying to do.
Posted on 2002-02-22 09:27:41 by savage
Hi savage

You need to set the stack pointer wich, in my opinion, is a bad programming habit when using masm.
What I would do is return a flag in eax and test on it in the main proc.

Posted on 2002-02-22 09:36:06 by KetilO
thanks for the reply Ketilo

i actually tested the return value in the main proc the first time, but i am using it for in a dll, and in every dll call the subcall is called to get the handle of the window. so i thought i might do it this way to save some space :grin:

but i think i'll follow your advice and keep it like this ;)
Posted on 2002-02-22 10:04:17 by savage