Solved

button id

Posted on 1998-04-13
2
168 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 30 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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

751 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