Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

button id

Posted on 1998-04-13
2
Medium Priority
?
170 Views
Last Modified: 2010-04-10
I am writing a window application, in C++ from scratch.   In my UI, I have a pushbutton....when
pushed, I pull off the message and switch on the type of message, i.e. LBUTTONDN.  My
question is this:  Does this pushbutton have an  ID?  If so, how can I get it?  I am from a
MOTIF background so any comparisons would help....

thanks in advance
0
Comment
Question by:smithc
[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 4

Accepted Solution

by:
piano_boxer earned 60 total points
ID: 1184237
When you pushes the button it will send a WM_COMMAND message to its parent (owner). When you receive this message you can get the id of the control which triggered the WM_COMMAND message by doing this:

WORD wId = LOWORD(wParam);
0
 
LVL 11

Expert Comment

by:alexo
ID: 1184238
If you create your dialog using a resource editor, the control's ID is defined in the include file (usually resource.h).

Also, look at the functions GetDlgCtrlID() and GetDlgItem().
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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

705 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