Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

PASS_DIR_CNTRLC in Quickwin

hkausl
Beginner
563 Views
Hello,
I have a quickwin applicatioan and deletet all the menue properties. I want to use cntrlc to do an internal command. When I use passdirkeysqq with PASS_DIR_CNTRLC I cannot catch the event. My program ends as it is in a normal application.
0 Kudos
5 Replies
Paul_Curtis
Valued Contributor I
563 Views
Most or many system keypresses are not hookable by your program, precisely because they are reserved for system use. The API function RegisterHotKey() can be used to trap system keypresses which then show up as WM_HOTKEY messages in your main message loop.
0 Kudos
hkausl
Beginner
563 Views
thanks for the answer. But in documentation there's written, that this key can be passed. I' ll try your solution.

PS: Do you have an example on how to do this.
0 Kudos
Paul_Curtis
Valued Contributor I
563 Views
I do not use Quickwin, but my understanding is that the point of Quickwin is that you don't have to (or get to) run your program's message loop, so this method may not work with Quickwin. Here is a code sample showing the trapping of various Windows keys:

[bash]!   (arbitrary) placeholder values for system hotkey structures
INTEGER, PARAMETER      :: hk_alttab = 100
INTEGER, PARAMETER      :: hk_altesc = 101

!   cause Windows to send a WM_HOTKEY to the main window
!   proc so system (ie, non-hookable) hotkeys can be trapped
rval = RegisterHotKey (ghwndMain, hk_alttab, MOD_ALT, VK_TAB)
rval = RegisterHotKey (ghwndMain, hk_altesc, MOD_ALT, VK_ESCAPE)


! this code would appear in the main Windows message loop proc function

!   block further processing of Windows hotkeys
CASE (WM_HOTKEY)
    MainWndProc = 0    ! or whatever you want at this point
[/bash]
0 Kudos
hkausl
Beginner
563 Views
I tried to register the contorl-key in combination with the C with an alias. Whenn pressing cntrl c the program finishes at once.
0 Kudos
hkausl
Beginner
563 Views
Now it works, I had problems with the deletemenuqq for the exit submenu. I deleted all main-menus including the submenues, then it didn't work. No I delete at first explicitly the exit submenue and then all other menues, then it works.
0 Kudos
Reply