Solved

how to Case a UINT

Posted on 1998-12-07
2
333 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
logging Access violation 6 24
Best UNIX-compatible free C compiler for Windows or Mac 6 284
C#, VS15, StructLayout 1 137
Socket Programming (Unix) 8 157
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

738 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