Hi Frank,
Thanks for the reply.
As far as the C startup code calling GetModuleHandle my guess was the same as yours except that the values returned are radically different. GetModuleHandle always reports the start of the application code in memory -on my machine with Olly debug it's always around 0040 0000h.
But if I call WinMain without GetModuleHandle then hInstance reports a *very* high hex value on the order of 0ffdf1234.
Yet both values satisfy the system as hInstance.
And if I want to use WinMain directly I find that have to drop into the WinMain proc by "default"
start:
proc WinMain (hInstance),. . .etc.
. . .
message pump
. . .
mov eax, dword [msg +MSG.wParam]
ret
endproc
Ending the application directly out of the procedure seems awkward to me but if I trace it in the debugger it does return to the system code for ExitUserThread with no apparent "leftovers".
;----------------------------
It was an interesting experiment but I think that eliminating two lines of code for GetModuleHandle isn't worth the nagging worry that it's there for a reason.
Instead of wasting any more of anyone's time I think I'll stick to the "way we've always
done things around here " ;-)
Thanks again Frank.
afk