Solved

dialog box

Posted on 1998-01-27
7
816 Views
Last Modified: 2013-12-03
I am using CreateDialog() to create a dialog box with an edit control, an OK button, and a cancel button.
On the WM_INITDIALOG message I am selecting all the text in the editbox, and setting focus to the editbox. The OK button is defined as the default button.
The Tab,Enter, and Escape Keys only beep.
Should't these be handled by default by returning IDOK,IDCANCEL, etc?
I have tried looking for WM_KEYDOWN message, and still nothing. Any Suggestions?
0
Comment
Question by:marvinm
  • 4
  • 2
7 Comments
 
LVL 4

Expert Comment

by:tflai
ID: 1410400
You should try catching WM_COMMAND, and switch on LOWORD(wParam) on WM_TAB, WM_ESCAPE, etc.
0
 
LVL 1

Author Comment

by:marvinm
ID: 1410401
WM_TAB and WM_ESCAPE are not valid messages are they? they are undefined by my compiler. I've tried trapping WM_KEYDOWN and VK_RETURN,VK_ESCAPE, but this does not work.-mm
0
 
LVL 1

Author Comment

by:marvinm
ID: 1410402
Adjusted points to 200
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 4

Expert Comment

by:tflai
ID: 1410403
Did you use the default dialog message handler (only after you've caught all the WM_COMMAND, WM_INITDIALOG, ... etc)?

default:
  return DefDlgProc(hWndMain, msg, wParam, lParam);

0
 
LVL 1

Author Comment

by:marvinm
ID: 1410404
I am not using a separate window class for the dialog box window.
0
 

Accepted Solution

by:
PhilC earned 200 total points
ID: 1410405
You Need to alter your main processing loop:
....
while(GetMessage (&msg,NULL,0,0))
{
  if ((DialogWnd==NULL) || !IsDialogMessage(DialogWnd,&msg)) {
  TranslateMessage(&msg);
  DispatchMessage(&msg);
}
....

0
 
LVL 1

Author Comment

by:marvinm
ID: 1410406
did the trick.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

679 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