Buttons In Dialog Boxes
I have a button in my dialog box that when you click it the dialog box quits. However, it would be really nice if when I hit the enter/return key it would also quit the program. Can someone help me out? I'm using MSVC++ and the dialog box is in a resource file.
Check out WM_KEYDOWN or WM_CHAR.
Your default button should be a DEFPUSHBUTTON and you should have IsDialogMessage in your message loop. If you meet these two conditions, and the currently focused control does not use the enter key press, the dialog manager will "click" your default button when enter is pressed.