• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 672
  • Last Modified:

CreateWindow problem in MFC

Hi
  I have .cpp file derived fron CDialog.
Iam creation buttons ate run time using CreateWindow.
I want to display some messages when any button is pressed.
Can one help how to do it?

Thanks
Jaya
0
Jayalakshmi
Asked:
Jayalakshmi
2 Solutions
 
suganthkumar1Commented:
You can override the funtion OnCmdMsg in your derived class. in that function nID will give the ID of the Window, nCode gives the Notification code.

typically for buttons if you have button IDs, you can go for using a swicth statement and process different buttons.

0
 
PriyeshCommented:
BN_CLICKED notification is send using WM_COMMAND.
0
 
keitha1Commented:
If the id's you assign the controls are consecutive, you can use ON_COMMAND_RANGE to create a common handler and just check the id for what message to display.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now