<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ESC SHORTCUT FOR EXIT/CLOSE in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/ESC-SHORTCUT-FOR-EXIT-CLOSE/m-p/930913#M14779</link>
    <description>I guess my question is not a Fortran question. I should have looked at MSDN first. WM_KEYDOWN and WM_CHAR messages are passed to the control not to the application's windows procedure. &lt;BR /&gt;An article on using a message filter to detect F1 keystrokes requesting context sensitive help in a dialog box &lt;A href="http://support.microsoft.com/support/kb/articles/Q72/2/19.ASP"&gt;ID: Q72219&lt;/A&gt; discusses this issue. &lt;BR /&gt;It is apparently not as easy as I hoped. &lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;Walter Kramer &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;P.S.&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;Great improvement to have the forum sorted by date.</description>
    <pubDate>Sun, 10 Dec 2000 19:22:18 GMT</pubDate>
    <dc:creator>wkramer</dc:creator>
    <dc:date>2000-12-10T19:22:18Z</dc:date>
    <item>
      <title>ESC SHORTCUT FOR EXIT/CLOSE</title>
      <link>https://community.intel.com/t5/Software-Archive/ESC-SHORTCUT-FOR-EXIT-CLOSE/m-p/930912#M14778</link>
      <description>Hello, &lt;BR /&gt; &lt;BR /&gt;I would like to use the ESC-key as shortcut for closing a SDI application with a single edit control in the client area (the application is a simple text editor). &lt;BR /&gt;I have tried to use WM_KEYDOWN and WM_CHAR messages, but it seems that these messages are never send. Any key pressed generates a WM_COMMAND message. Even when focus is on the menu and I press a key, the WM_KEYDOWN message is still not send. &lt;BR /&gt;Am I missing something here? &lt;BR /&gt; &lt;BR /&gt;Walter Kramer</description>
      <pubDate>Sun, 10 Dec 2000 06:12:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/ESC-SHORTCUT-FOR-EXIT-CLOSE/m-p/930912#M14778</guid>
      <dc:creator>wkramer</dc:creator>
      <dc:date>2000-12-10T06:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: ESC SHORTCUT FOR EXIT/CLOSE</title>
      <link>https://community.intel.com/t5/Software-Archive/ESC-SHORTCUT-FOR-EXIT-CLOSE/m-p/930913#M14779</link>
      <description>I guess my question is not a Fortran question. I should have looked at MSDN first. WM_KEYDOWN and WM_CHAR messages are passed to the control not to the application's windows procedure. &lt;BR /&gt;An article on using a message filter to detect F1 keystrokes requesting context sensitive help in a dialog box &lt;A href="http://support.microsoft.com/support/kb/articles/Q72/2/19.ASP"&gt;ID: Q72219&lt;/A&gt; discusses this issue. &lt;BR /&gt;It is apparently not as easy as I hoped. &lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;Walter Kramer &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;P.S.&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;Great improvement to have the forum sorted by date.</description>
      <pubDate>Sun, 10 Dec 2000 19:22:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/ESC-SHORTCUT-FOR-EXIT-CLOSE/m-p/930913#M14779</guid>
      <dc:creator>wkramer</dc:creator>
      <dc:date>2000-12-10T19:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: ESC SHORTCUT FOR EXIT/CLOSE</title>
      <link>https://community.intel.com/t5/Software-Archive/ESC-SHORTCUT-FOR-EXIT-CLOSE/m-p/930914#M14780</link>
      <description>Hello, &lt;BR /&gt; &lt;BR /&gt;I managed to get things working using: &lt;BR /&gt; &lt;BR /&gt;&lt;PRE&gt; &lt;BR /&gt;  case (WM_CREATE) &lt;BR /&gt;    !// Create the edit control child window &lt;BR /&gt;    lParam=ghInstance &lt;BR /&gt;   ghHook=SetWindowsHookEX(WH_KEYBOARD, LOC(EscKeyProc), ghInstance, GetCurrentThreadID())                         &lt;BR /&gt;    hwndEdit = CreateWindowEx(0,"edit"C,  &amp;amp; &lt;BR /&gt;                            ""C,      &amp;amp; &lt;BR /&gt;                            IOR(WS_CHILD, IOR(WS_VISIBLE,                &amp;amp; &lt;BR /&gt;                            IOR(WS_HSCROLL, IOR(WS_VSCROLL,              &amp;amp; &lt;BR /&gt;                            IOR(WS_BORDER, IOR(ES_LEFT,                  &amp;amp; &lt;BR /&gt;                            IOR(ES_MULTILINE, IOR(ES_NOHIDESEL,          &amp;amp; &lt;BR /&gt;                            IOR(ES_AUTOHSCROLL, IOR(ES_READONLY,         &amp;amp; &lt;BR /&gt;                                ES_AUTOVSCROLL)))))))))), &amp;amp; &lt;BR /&gt;                            0, 0, 0, 0, &amp;amp; &lt;BR /&gt;                            hwnd, EDITID, ghInstance, NULL) &lt;BR /&gt;    ghwndEdit=hwndEdit &lt;BR /&gt;    hBrushEdit = CreateSolidBrush(GetSysColor(COLOR_BTNHIGHLIGHT)) &lt;BR /&gt;    iret=SendMessage(hwndEdit,EM_LIMITTEXT,32000,0) &lt;BR /&gt;&lt;/PRE&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;The hook procedure is:&lt;BR /&gt; &lt;BR /&gt;&lt;PRE&gt; &lt;BR /&gt;integer*4 function EscKeyProc(nCode, wParam, lParam)  &lt;BR /&gt;  !DEC$ IF DEFINED (_X86_) &lt;BR /&gt;    !DEC$ ATTRIBUTES STDCALL, ALIAS: '_EscKeyProc@12' :: EscKeyProc &lt;BR /&gt;  !DEC$ ELSE &lt;BR /&gt;    !DEC$ ATTRIBUTES STDCALL, ALIAS: '_EscKeyProc' :: EscKeyProc &lt;BR /&gt;  !DEC$ ENDIF  &lt;BR /&gt;  use NemListGlobals &lt;BR /&gt;  use Dfwbase &lt;BR /&gt;  integer*4, intent(in) ::  nCode   ! hook code  &lt;BR /&gt;  integer*4, intent(in) ::  wParam  ! virtual-key code  &lt;BR /&gt;  integer*4, intent(in) ::  lParam  ! keystroke message information &lt;BR /&gt;  integer*4 hwnd &lt;BR /&gt;  integer*4 iret &lt;BR /&gt;  hwnd=getFocus() &lt;BR /&gt;  iret=HIWORD(lParam) &lt;BR /&gt;  if ((nCode==HC_ACTION).AND.(wParam==VK_ESCAPE).AND.(hwnd==ghwndEdit).AND. &amp;amp; &lt;BR /&gt;  (IAND(KF_MENUMODE,iret)==0)) then &lt;BR /&gt;    iret=PostMessage(getParent(hwnd), WM_CLOSE, 0, 0) &lt;BR /&gt;    EscKeyProc = 1 ! non zero to stop further processing   &lt;BR /&gt;    return &lt;BR /&gt;  endif &lt;BR /&gt;  EscKeyProc = CallNextHookEx(ghHook, nCode, wParam, loc(lParam)) &lt;BR /&gt;  return &lt;BR /&gt;end function EscKeyProc &lt;BR /&gt;&lt;/PRE&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;IAND(KF_MENUMODE,iret)==0 makes sure that the ESCAPE key doesn't &lt;BR /&gt;function as shortcut for EXIT while the menu is active.&lt;BR /&gt; &lt;BR /&gt;Remains one question.&lt;BR /&gt; &lt;BR /&gt;If the menu is active and I press ESC the pull down closes, but optically it seems that the menu is still active (blue color or shadow).&lt;BR /&gt; &lt;BR /&gt;How can I trap this state? I would like that ESC will not work as shortcut for EXIT under these circumstances either.&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;Thanks, &lt;BR /&gt; &lt;BR /&gt;Walter Kramer</description>
      <pubDate>Tue, 12 Dec 2000 09:52:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/ESC-SHORTCUT-FOR-EXIT-CLOSE/m-p/930914#M14780</guid>
      <dc:creator>wkramer</dc:creator>
      <dc:date>2000-12-12T09:52:16Z</dc:date>
    </item>
  </channel>
</rss>

