afx_msg void OnSysChar( UINT nChar, UINT nRepCnt, UINT nFlags );
nChar
Specifies the ASCII-character key code of a Control-menu key.
nRepCnt
Specifies the repeat count (the number of times the keystroke is repeated as a result of the user holding down the key).
nFlags
The nFlags parameter can have these values:
Value | Description |
0–7 | Scan code (OEM-dependent value). Low byte of high-order word. |
8 | Extended key, such as a function key or a key on the numeric keypad (1 if it is an extended key, 0 otherwise). |
9–10 | Not used. |
11–12 | Used internally by Windows. |
13 | Context code (1 if the ALT key is held down while the key is pressed, 0 otherwise). |
14 | Previous key state (1 if the key is down before the message is sent, 0 if the key is up). |
15 | Transition state (1 if the key is being released, 0 if the key is being pressed). |
Called if CWnd has the input focus and the WM_SYSKEYUP or WM_SYSKEYDOWN message is received. It specifies the virtual-key code of the Control-menu key.
When the context code is 0, WM_SYSCHAR can pass the WM_SYSCHAR message to the TranslateAccelerator Windows function, which will handle it as though it were a normal key message instead of a system-key message. This allows accelerator keys to be used with the active window even if the active window does not have the input focus.
For IBM Enhanced 101- and 102-key keyboards, enhanced keys are the right ALT and the right CONTROL keys on the main section of the keyboard; the INSERT, DELETE, HOME, END, PAGE UP, PAGE DOWN, and ARROW keys in the clusters to the left of the numeric keypad; and the slash (/) and ENTER keys in the numeric keypad. Some other keyboards may support the extended-key bit in nFlags.
This message-handler member function calls the Default member function. Override this member function in your derived class to handle the WM_SYSCHAR message.
::TranslateAccelerator, WM_SYSKEYDOWN, WM_SYSKEYUP, CWnd::Default, WM_SYSCHAR