Default CButton doens't work when created programmatically
Posted on 2007-04-03
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?