Solved

how to Case a UINT

Posted on 1998-12-07
2
336 Views
Last Modified: 2010-04-15
A windoze "C" question

If two different applications register the same message string, the applications return the same message value. The message remains registered until the Windows session ends.
like this ........

UINT NEW_MSG  = RegisterWindowMessage("NEW_BROADCAST_MESSAGE")

And 1 app can broadcast the new message.

PostMessage(HWND_BROADCAST, NEW_MSG,  wParam,  LPARAM lParam);

How does the other app use it's received NEW_MSG when integral constants are required by
CASE: ??????

case WM_COMMAND:
switch(LOWORD (wParam)) {
case NEW_MSG: // ERROR !!!!!!!!!!!
0
Comment
Question by:wayan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
Answers2000 earned 50 total points
ID: 1254914
1. Test again the message not the parameter WPARAM.
2. use an if statement separate from your case statement (you can't test using a case statement for the reason you state, this is limitation of switch/case)

e.g.

LRESULT WndProc( HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam )
{

if ( uMessage == NEW_MSG )
{
/* Do something */
return 0;
}

switch (uMessage)
{
 /* etc */
0
 

Author Comment

by:wayan
ID: 1254915
thanks your answer is 100% right
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question