Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 360
  • Last Modified:

"Enter" not working in dialog with CreateDialog

The enter key does not activate the default button in a dialog created using CreateDialog() (the spacebar activates the default). This works fine with DialogBox(), what's up? Also, anyway to disable the spacebar from activating the default action? NOTE: not using MFC
0
cbabcock073098
Asked:
cbabcock073098
  • 2
  • 2
1 Solution
 
WxWCommented:
Modeless dialog boxes are NOT checking for Enter or Tab , to fire the default button or to switch between controls . Try to apply WS_EX_CONTROLPARENT to your dialog . If it does not work , you need to capture and handle the Tab and the Enter key .
0
 
alexoCommented:
Modify your message loop to include IsDialogMessage()
Also See KB articles Q96134 and Q71450

0
 
cbabcock073098Author Commented:
Thanks for the help. Alexo you were right on with the IsDialogMessage call.
0
 
alexoCommented:
>> Alexo you were right on with the IsDialogMessage call.
However, you accepted WxW's answer and awarded him the points :-(
0
 
WxWCommented:
Yes .I agree that Alexo should take the points .
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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