I have trapped the WM_Create message and I need to get at the nWidth and nHeight members of the CREATESTRUCT that lParam points to. I'm not sure how to do this I think it is something like lParam.nWidth but that dosen't work can someone explain what I should do thank you
Posted on 2001-11-28 17:13:11 by asmnewbie1
I think you should give a name to CREATESTRUCT structure. You can put, for example, in .data section:




may be used to work with the structure.

Hoping to be helpful,

Posted on 2001-11-28 17:24:17 by CodeLover
To take CodeLover's answer one step further, do the following inside your message handler for WM_CREATE:

mov esi, lParam
assume esi : ptr CREATESTRUCT
mov eax, [esi].hInstance

once you have finished with esi, do this:

assume esi : nothing

by doing this, you can just use esi (or the register of your choice) as a pointer to the CREATESTRUCT struct that you are passed, and MASM will calculate all the offsets for you.
Posted on 2001-11-28 18:56:32 by sluggy