Link to home
Start Free TrialLog in
Avatar of kevinbenedict
kevinbenedict

asked on

Default CButton doens't work when created programmatically

When I create a CButton using Create, and I set the style to BS_DEFPUSHBUTTON, the button doesn't receive the button click message when the user hits the enter key.  It generates the OnOK message.  When the button is created using the resource editor and the style is set to default button, everything works correctly.  How do I make a button the default button when creating it programmatically?  Do I have to determine the default myself by handling the DM_GETDEFID message?  Is there a better way?
ASKER CERTIFIED SOLUTION
Avatar of Priyesh
Priyesh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Be sure that no other buttons in the dialog have the BS_DEFPUSHBUTTON style
Avatar of kevinbenedict
kevinbenedict

ASKER

This works great in Windows but not on a PocketPC for some reason.  I am using eVC++ and am targeting mobile devices.