Solved

dialog box

Posted on 1998-01-27
7
819 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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

 
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

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.

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 …
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

732 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