Solved

button id

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

911 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now