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
I think you should give a name to CREATESTRUCT structure. You can put, for example, in .data section:
struct CREATESTRUCT <>
Then,
struct.cx
struct.cy
struct.x
struct.y
may be used to work with the structure.
Hoping to be helpful,
CodeLover.
struct CREATESTRUCT <>
Then,
struct.cx
struct.cy
struct.x
struct.y
may be used to work with the structure.
Hoping to be helpful,
CodeLover.
To take CodeLover's answer one step further, do the following inside your message handler for WM_CREATE:
once you have finished with esi, do this:
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.
mov esi, lParam
assume esi : ptr CREATESTRUCT
mov eax, [esi].hInstance
...etc...
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.