1

I have a simple Dialog Box having an entry field ( one line ) a default "Find" button, and a Cancel button.

When I instantiate this dialog as modal, if I hit ENTER while I am typing the Find button is activated, which is the desired behavior. When I instantiate it as modeless and hit ENTER while in the entry field the speaker beeps instead.

Has anyone any ideas what I have to do to get the same behavior in modeless mode as in modal?

thanks in advance

George T.
  • 119
  • 4
  • 2
    Possible duplicate of [How to turn off beeping when pressing ENTER on a single-line EDIT control under Windows CE?](http://stackoverflow.com/questions/3588526/how-to-turn-off-beeping-when-pressing-enter-on-a-single-line-edit-control-under) –  Feb 15 '17 at 21:26
  • Is your *Find* button created with the `BS_DEFPUSHBUTTON` [button style](https://msdn.microsoft.com/en-us/library/windows/desktop/bb775951.aspx)? – IInspectable Feb 15 '17 at 21:28
  • Yes, of course, Find has the BS_DEFPUSHBUTTON. that's why its activated in modal... Regarding the previous comment, sub-classing will probably do the job, but the dialog woks fine in modal; why it should not work in modeless? – George T. Feb 15 '17 at 21:32
  • 3
    Are you calling [IsDialogMessage](https://msdn.microsoft.com/en-us/library/windows/desktop/ms645498.aspx) as part of your message dispatching loop? That's what the modal dialog loop does, but since you are running a modeless dialog, you are responsible for handling keyboard navigation yourself. – IInspectable Feb 15 '17 at 21:38

0 Answers0