Solved

"Enter" not working in dialog with CreateDialog

Posted on 1998-07-30
5
330 Views
Last Modified: 2013-12-03
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
Comment
Question by:cbabcock073098
  • 2
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
WxW earned 20 total points
ID: 1411953
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
 
LVL 11

Expert Comment

by:alexo
ID: 1411954
Modify your message loop to include IsDialogMessage()
Also See KB articles Q96134 and Q71450

0
 

Author Comment

by:cbabcock073098
ID: 1411955
Thanks for the help. Alexo you were right on with the IsDialogMessage call.
0
 
LVL 11

Expert Comment

by:alexo
ID: 1411956
>> Alexo you were right on with the IsDialogMessage call.
However, you accepted WxW's answer and awarded him the points :-(
0
 
LVL 6

Expert Comment

by:WxW
ID: 1411957
Yes .I agree that Alexo should take the points .
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now