Solved

"Enter" not working in dialog with CreateDialog

Posted on 1998-07-30
5
332 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

896 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

15 Experts available now in Live!

Get 1:1 Help Now