-
April 30th, 2004, 08:36 AM
#1
Do you use WM_NULL?
I have found funny windows message.
It is described in MSDN so:
WM_NULL
The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore.
I propose competition on the best idea how to use it
-
April 30th, 2004, 09:08 AM
#2
Better, read all the documentation before -ing and say "funny".
From MSDN
WM_NULL
[...]
Remarks
For example, if an application has installed a WH_GETMESSAGE hook and wants to prevent a message from being processed, the GetMsgProc callback function can change the message number to WM_NULL so the recipient will ignore it.
As another example, an application can check if a window is responding to messages by sending the WM_NULL message with the SendMessageTimeout function.
-
April 30th, 2004, 09:23 AM
#3
Re: Do you use WM_NULL?
Originally posted by Alex Rest
I have found funny windows message.
.
.
.
An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore.
I do not see anything funny about that. Just to give you few examples:
This message is used to test if application is still responding and is not hang. Task manager does that by using SendMessageTimeout with WM_NULL.
WM_NULL is also used to filter messages in WH_GETMESSAGE hook. Returning 0 from a hook does not prevent from processing a message. Replacing message with WM_NULL will filter message properly.
Another use is ActiveX control when you decide that it has toolbar and tooltips. Normally application message pump calls PreTranslateMessage; since ActiveX control does not have one, message hook can call PreTranslateMessage and if handled replace original message with WM_NULL.
There are only 10 types of people in the world:
Those who understand binary and those who do not.
-
April 30th, 2004, 10:44 AM
#4
O!
I am agree.
It is useful.
Thanks for good examples.
-
April 30th, 2004, 11:28 AM
#5
Hi Alex,
Just joking...
You were like a Java-fan wondering: "What is NULL good for???"
Keep ahead!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|