News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Trap Status Message & EnableMenuItem

Started by V Coder, February 05, 2006, 05:31:33 AM

Previous topic - Next topic

V Coder

I wish to trap exactly when a Status message sent to hWndStatus using SendMessage is processed, as well as when EnableMenuItem send to hMenu is processed. What do I have to check for in the WndProc please?

if uMsg=??

Thanks.

zooba

Quote from: V Coder on February 05, 2006, 05:31:33 AM
...exactly when...

Does this mean you want to get the timestamp of the message?

If it doesn't, and you want to process the messages, ensure that the window procedure is handling that handle's messages (with SetWindowLong GWL_WNDPROC, hWnd) and then check the hWnd and dwMsg parameters:

mov eax, hWnd
mov ecx, dwMsg
.if(eax == hWndStatus && ecx == STATUS_MESSAGE)
    ; your code here
.endif

V Coder

A routine does the SendMessage(hWndStatus), and the WndProc actually does the EnableMenuItem calls, but the Message appears and the Menu Items change some seconds after the trigger for these actions is given. I want the program to know exactly when the the Message is being processed by the WndProc, and when the Menu Item is being set, so that it can now restart doing processing. If it restarts processes earlier it interrupts another routine, and the data never gets written to disk.

In my program I output a copy of all WndProc Messages that are not processed by my WndProc handler (those that are passed on to DefWndProc). However I want to know exactly what those codes refer to.

Randy's HLA has in the w.hhf file a list of several WM_**** codes, but I see some that are not listed in w.hhf, so I was wondering exactly what to look for.


zcoder

V Coder,
I don't understand what you mean. At least to me it would sound like you
are sending a message to a statusbar(hWndStatus) using SendMessage
and you want to know when that message is acted on??

If so, then  look at it this way:
When you send a message using SendMessage by the time your program returns from
SendMessage the message could have been acted on or windows mayhave put it on a que.
so without really subclassing into the statusbar there is no way to know.

If this is not what you wanted, then could you explain what you are trying to make
so we could understand more of what you are tring to achive?

Zcoder....

Back in 1979, My computer ran so fine.
And there was no such thing,
As a Microsoft Crashed Machine.
http://zcoder.110mb.com
http://www.dietzel.com/partner/idevaffiliate.php?id=345_6  Free Domain Names

V Coder

That's right. It is the Status bar of the particular application.

Why do we have to subclass into the status bar? In order to process it from WinProc?

k3Eahn

#5
V Coder,
Originally SendMessage is a syncronous function even for messaging windows of another threads. So theoretically by the
time sent message would have been processed  is the time your code is given back control.
Here goes the question : Do you sendmessage  to a window that belongs to another thread?
Sorry for English :(