<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Which message numbers belong to whom?</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx</link><description>Valid window messages break down into four categories.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>RE: Which message numbers belong to whom?</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#55915</link><pubDate>Tue, 02 Dec 2003 19:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:55915</guid><dc:creator>KiwiBlue</dc:creator><description>I remember reading somewhere that for backward compatibility reasons Windows will actually marshall cross-process messages above WM_USER for classes like listbox etc. Can you comment on that? </description></item><item><title>RE: Which message numbers belong to whom?</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#55916</link><pubDate>Tue, 02 Dec 2003 20:13:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:55916</guid><dc:creator>Raymond Chen</dc:creator><description>If you look closely at winuser.h, you'll see that all those messages got renumbered to be below WM_USER.

#define LB_ADDSTRING            0x0180
#define LB_INSERTSTRING         0x0181

etc.
</description></item><item><title>RE: Which message numbers belong to whom?</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#55917</link><pubDate>Tue, 02 Dec 2003 21:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:55917</guid><dc:creator>KiwiBlue</dc:creator><description>You're right. The funny thing is that LB_ADDSTRING is also #defined in winres.h as (WM_USER + 1), at least in SDK which ships with VC6.</description></item><item><title>RE: Which message numbers belong to whom?</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#55918</link><pubDate>Wed, 03 Dec 2003 01:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:55918</guid><dc:creator>Jordan Russell</dc:creator><description>There isn't any way to free a registered message, is there?</description></item><item><title>RE: Which message numbers belong to whom?</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#55919</link><pubDate>Wed, 03 Dec 2003 01:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:55919</guid><dc:creator>Jordan Russell</dc:creator><description>Oh, something else I've always wondered: What is *supposed* to happen when the registered message pool is exhausted? It seems that (on Windows 2000) RegisterWindowMessage() will loop back to 0xC000 and start returning identifiers that were already registered under different names. Is this intentional?</description></item><item><title>RE: Which message numbers belong to whom?</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#55920</link><pubDate>Wed, 03 Dec 2003 04:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:55920</guid><dc:creator>John Schroedl</dc:creator><description>Speaking of Atoms..how about a posting about their uses/merits/etc.  I rarely think to use one..when should I?

Thanks for a great blog!
</description></item><item><title>RE: Which message numbers belong to whom?</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#55921</link><pubDate>Wed, 03 Dec 2003 08:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:55921</guid><dc:creator>Anonymous</dc:creator><description>You can't explicitly free the message, it's handled automagically when your app quits (and no you can't even free it with GlobalDeleteAtom). And I'm sure there is some refcounting goodness in the object manager to account for multiple processes registering the message. As for what is the merits of atoms... It's just a hash table so I'm sure you mean the global one since that is more interesting. Basically that is mostly good for keeping track of wndclasses, easy way to check if multiple processes are open, or for easy communication between processes. But there are much, much better ways for the latter two.</description></item><item><title>RE: Which message numbers belong to whom?</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#55922</link><pubDate>Wed, 03 Dec 2003 08:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:55922</guid><dc:creator>Jordan Russell</dc:creator><description>In my tests, registered messages don't appear to be (completely?) freed when a process terminates. If I register two messages in application, then swap the order in which the messages are registered and run it again, each message gets the same ID as before.</description></item><item><title>RE: Which message numbers belong to whom?</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#55923</link><pubDate>Wed, 03 Dec 2003 09:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:55923</guid><dc:creator>Anonymous</dc:creator><description>Eh? That's probably because the string gets hashed to the same numeric value again.</description></item><item><title>RE: Which message numbers belong to whom?</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#55924</link><pubDate>Wed, 03 Dec 2003 11:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:55924</guid><dc:creator>Jordan Russell</dc:creator><description>I don't think that's the case. On Windows 2000 and XP, the IDs seem to be assigned sequentially; the content of the string doesn't matter.</description></item><item><title>RE: Which message numbers belong to whom?</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#55925</link><pubDate>Wed, 03 Dec 2003 18:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:55925</guid><dc:creator>Raymond Chen</dc:creator><description>Registered window messages cannot be freed; once they've been created they will hang around until you log off.

In Windows 3,1/95/98/etc,, the numerical value of a registered window message was based on the address of the hash table entry for the name, so they looked pseudorandom.  In Windows NT/2000/XP/etc., the numerical values are sequentially assigned in order of request.

</description></item><item><title>RE: Which message numbers belong to whom?</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#55926</link><pubDate>Wed, 03 Dec 2003 20:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:55926</guid><dc:creator>Jordan Russell</dc:creator><description>Thanks for the clarification. :)</description></item><item><title>The bonus window bytes at GWLP_USERDATA</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#384287</link><pubDate>Thu, 03 Mar 2005 18:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:384287</guid><dc:creator>The Old New Thing</dc:creator><description>A predefined place to hide a pointer-sized value.</description></item><item><title>Remember what happens when you broadcast a message</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#625323</link><pubDate>Sat, 10 Jun 2006 17:00:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:625323</guid><dc:creator>The Old New Thing</dc:creator><description>Most messages are not safe to broadcast.</description></item><item><title>Remember what happens when you broadcast a message</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#628194</link><pubDate>Mon, 12 Jun 2006 17:29:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:628194</guid><dc:creator>The Old New Thing</dc:creator><description>Most messages are not safe to broadcast.</description></item><item><title>Waiting until the dialog box is displayed before doing something</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#770541</link><pubDate>Mon, 25 Sep 2006 17:00:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:770541</guid><dc:creator>The Old New Thing</dc:creator><description>Answer to previous exercise.</description></item><item><title>When something is available for the user, which user are we talking about?</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#812821</link><pubDate>Tue, 10 Oct 2006 17:00:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:812821</guid><dc:creator>The Old New Thing</dc:creator><description>&lt;p&gt;And when something is reserved, who's it reserved for?&lt;/p&gt;
</description></item><item><title>If control-specific messages belong to the WM_USER range, why are messages like BM_SETCHECK in the system message range?</title><link>http://blogs.msdn.com/oldnewthing/archive/2003/12/02/55914.aspx#4854503</link><pubDate>Mon, 10 Sep 2007 19:26:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4854503</guid><dc:creator>MSDN Blog Postings  » If control-specific messages belong to the WM_USER range, why are messages like BM_SETCHECK in the system message range?</dc:creator><description>&lt;p&gt;PingBack from &lt;a href="http://blogs.msdn.com/oldnewthing/archive/2007/09/10/4849069.aspx"&gt;http://blogs.msdn.com/oldnewthing/archive/2007/09/10/4849069.aspx&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>