Solved

How to disable esc key

Posted on 1998-03-16
2
1,260 Views
Last Modified: 2013-12-03
My app has a modeless dialog box that needs to remain on the desktop as long as the app is running. However when I hit the 'Esc' key my dialog box goes away. How can I alter this behavior?
0
Comment
Question by:eejay
2 Comments
 
LVL 4

Accepted Solution

by:
tflai earned 50 total points
ID: 1412081
BOOL CMyWnd::PreTranslateMessage(MSG* pMsg)
{
      if (pMsg->message == WM_KEYDOWN)
      {
            switch(pMsg->wParam)
            {
            case VK_ESC:
                  return TRUE;
            }
      }
      return CDialog::PreTranslateMessage(pMsg);
}
0
 

Author Comment

by:eejay
ID: 1412082
That works very nicely. Thanx.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Method 'OpenReport' of the object Docmd failed 7 30
Need to create an object factory 2 46
VS2015 Redefinition errors 4 51
How can my static class become undefined?? 8 49
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

770 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