How would you translate this into MASM syntax?
I am stumped on this one

want to handle the WM_GETMINMAXINFO message and the C prototype is this:

WM_GETMINMAXINFO
lpmmi = (LPMINMAXINFO) lParam; // address of structure

i want to handle this is my WndProc in ASM ie.

LOCAL info:MINMAXINFO

.if eax==WM_GETMINMAXINFO
mov info, addr lParam
mov info.member, 20 ;something like this
.endif

I know this doesn't work. Wrong types.

How do you cast lParam to MINMAXINFO and then use it. I am a C programmer , so the ASM is slipping my mind on this one and all I see is the C/C++ way of doing it.

any help appreciated
Posted on 2002-01-02 20:04:03 by Rockinronstar
Hi Rockinronstar

When WM_GETMINMAXINFO is sendt to your window, lParam contains a pointer to a MINMAXINFO structure. To change some values in the structure do this:

mov edx,lParam
mov (MINMAXINFO ptr ).ptMaxSize.x,400
mov (MINMAXINFO ptr ).ptMaxSize.y,300
.
.
.

KetilO
Posted on 2002-01-03 03:04:46 by KetilO
thanx.

mov (MINMAXINFO ptr ).ptMaxSize.y,300

this looks to me like a C style cast?? Didn't know stuff like this was possible in ASM

is this part of the high level aspects of MASM?

wondering if this translates into more ASM internally.

oh ya, thanx - saved me a headache or 7...

also, since you are the RAD guy, do you know how to intercept specific messages fropm controls.

ie, lets say I have a statusbar on the bottom of my window.
I know it sends a WM_NOTIFY to its parent, but how can you check for specific messages from the control itself. For example intercepting a WM_LMOUSEBUTTONDOWN from it?

And wondering whether the concept of subclassing controls and adding new events/functionality is possible with ASM? And overriding events within the control.

One of the biggest things I have trouble dealing with is that big ass messageloop I am building in my ASM apps, don't know if this can be avoided. Basically if you have 30 menu options handled in a WM_COMMAND message of your main window messageproc, you got 30 .elseif blocks just in that one section alone. Wondering if its preferable to make seperate files for some of these messages and then when you get a WM_COMMAND, the code jumps to a seperate function in a different file and handles the messages and actions there? I guess its a style question especially for large projects. Also, when you have a control like a statusbar or an Edit control, the messages are handled within the message proc for that control that I have no access to. Hence, how do you override them? If I don't want to use your WM_DBLCLICK , I want to custom my own, how can you do this?

thanx
Posted on 2002-01-03 06:54:08 by Rock
Hi Rock

The asm transforms into:
mov (MINMAXINFO ptr ).ptMaxSize.x,400 --> mov ,400
mov (MINMAXINFO ptr ).ptMaxSize.y,300 --> mov ,300

Subclassing is the answer to most of your questions.

invoke SetWindowLong,hCtl,GWL_WNDPROC,offset MyCtlProc
mov lpOldMyCtlProc,eax

does the trick.


The WM_COMMAND can be a large part of the WndProc.
You can split it up the way you want. It is only a matter of coding style.

KetilO
Posted on 2002-01-03 07:12:03 by KetilO
Hello Guys

I hate to bring up this good old news but i just got interested in the messageloop.. Please tell me i can send a message like FindWindow and have it loop back to me.....If so Dammmmmmmm.

A typical messageloop
.while TRUE
invoke GetMessage,addr msg,NULL,0,0
.break .if !eax
invoke IsDialogMessage,hFind,addr msg<<<<<<
.if !eax
invoke TranslateMessage,addr msg
invoke DispatchMessage,addr msg
.endif
.endw

This came from the old post under yours....I thought the message loop was good for nothing other than a keyboard press....I'm going to try some of this stuff out....Now that looks like FUN AGAIN!!!
Posted on 2002-02-24 14:07:09 by cmax