Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Messages 49417 - 49420

Status
Not open for further replies.

GameDude

Programmer
Jun 22, 2004
23
US
I'm using PeekMessage in my message queue, but try to filter any messages not needed. For example, I tell my program to ignore any key-down messages because I handle input differently.

Recently, however, I've been getting messages reguardless of my not interacting with the program at all. The three messages in particular it's picking up have the message numbers 15, 49417, and 49420.

Message number 15 coorisponds to the WM_PAINT message, which I understand as my program is using BitBlt to place things on the screen. However, I don't know what the other two numbers coorispond to, or why they haven't disrupted my program before now.

Here's some sample code:

Code:
	totalTime = GetTickCount();
	currentTick = GetTickCount();
	elapsedTime = 2000;
	running = true;
	int numFrames = 0;
	int numUpdates = 0;
	int numMessages = 0;
	vector<UINT>*messages = new vector<UINT>();
	UINT check = WM_PAINT;
	
	while(running)					
	{
		currentTick = GetTickCount();
		
		if( PeekMessage( &lpMsg, NULL, 0U, 0U, PM_REMOVE ) &&
			lpMsg.message != WM_KEYDOWN &&
			lpMsg.message != WM_KEYUP &&
			lpMsg.message != WM_MOUSEMOVE)
        {
            TranslateMessage( &lpMsg );
            DispatchMessage( &lpMsg );
            numMessages++;
            messages -> push_back(lpMsg.message);
        }
        else
        {
			update();			
			numUpdates++;
		}
		
		numFrames++;
		
		if(keyboard -> keyIsDown(VK_ESCAPE))
			running = false;
			
		while((GetTickCount() - currentTick) < ((1 / 60.0) * 100))
			running = running;
		elapsedTime = GetTickCount() - currentTick;
	}
	
	for(int x = 0; x < messages -> size(); x++)
		check = (UINT)(messages -> at(x));
	delete messages;
 

0xC000 through 0xFFFF String messages for use by applications.

Message numbers in the fourth range (0xC000 through 0xFFFF) are defined at run time when an application calls the RegisterWindowMessage function to retrieve a message number for a string. All applications that register the same string can use the associated message number for exchanging messages. The actual message number, however, is not a constant and cannot be assumed to be the same between different sessions.

Looks like something to do with message dispatching (or the timers), that's application specific.

49417 and 49420 are 0xC109 and 0xC10C respectively.
 
My program doesn't have any application-specific messages to dispatch. It has to be a default windows message...

I made a giant switch statement containing every windows message in existance. Unfortunately, neither 0xC109 nor 0xC10C register under any of the messages I placed. Heck, 15 didn't even register under the WM_PAINT message, which was unnerving, as my switch statement was double and triple-checked. It should have caught it.

Any ideas on how I can find out what 0xC109 and 0xC10C are?
 
As Glenn9999 wrote, messages in this range are registered messages. These messages don't have to be coded in your application, because they can be registered and sent by any process. In fact, registered messages are meant and used for communication between two or more processes.
If you have Visual Studio, you can use Spy++, which shows you if it is in fact a registered message and if it is, it shows the name under which it is registered.

Marcel
 
My program doesn't have any application-specific messages to dispatch. It has to be a default windows message...

Like MKuiper says, they don't have to be specifically coded by you in the application, but they could be set up behind the scenes to handle some kind of call you made in the application (like GetTickCount). It could be that you're seeing the mechanics of the programming language that you are using to do something behind the scenes that you're asking it to do.
 
I understand.

It would be nice to have that Spy++ tool, but I'm not using Visual Studio. I'm using Codewarrior. Is there some other tool I could use to find if it is a registered message, and show the name under which it is registered?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top