Make your own free website on Tripod.com
 
« October 2006 »
S M T W T F S
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
You are not logged in. Log in

Programming Tips
Tuesday, 31 October 2006
How to get the string that is used to register a message using RegisterWindowMessage
Mood:  party time!
Topic: VC++

It's quite common that we use RegisterWindowMessage to register a message that is used for all instances of this application.

Have you ever wondered how to get the text back from from the message number that is returned by RegisterWindowMessage?

This will make it more clear...

const UINT uMyWndMessageReg = ::RegisterWindowMessage( _T( "Nibu is testing" ));

Now how to get back "Nibu is testing" from uMyWndMessageReg?

Well this is how we do it...

TCHAR szMsgBuf[ MAX_PATH ];
GetClipboardFormatName( uMyWndMessageReg, szMsgBuf, MAX_PATH );

MessageBox( NULL, szMsgBuf, _T( "RegisterWindowMessage String" ), MB_OK | MB_ICONINFORMATION );

Ah wait I have a question for you, can you tell me what's going behind the scenes of RegisterWindowMessage. ;)


Posted by Nibu babu thomas at 2:00 PM
Updated: Monday, 27 November 2006 6:32 PM

View Latest Entries