msgs12.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
WM_VIOCHAR (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WININPUT
 
WM_VIOCHAR
fsKeyFlags = (USHORT) SHORT1FROMMP(mp1);    /* key flags    */
uchRepeat = (UCHAR) CHAR3FROMMP(mp1);       /* repeat count */
uchScanCode = (UCHAR) CHAR4FROMMP(mp1);     /* scan code    */
uchChr = (UCHAR) CHAR1FROMMP(mp2);          /* character    */
uchKbdScan = (UCHAR) CHAR2FROMMP(mp2);      /* virtual key  */
 
The WM_VIOCHAR message is sent whenever the user presses a key. This message
is placed in the queue associated with the window that has the focus.
 
Parameter    Description
────────────────────────────────────────────────────────────────────────────
 
fsKeyFlags   Low word of mp1. Specifies the keyboard control codes. This
             parameter may be one or more of the following values:
 
             Value           Meaning
             ───────────────────────────────────────────────────────────────
             KC_CHAR         Indicates that the uchChr parameter contains a
                             valid character. This bit will be set only on a
                             down stroke. KC_CHAR is not set if either the
                             KC_ALT or the KC_CTRL flag is set, even if
                             uchChr contains a valid character.
 
             KC_SCANCODE     Indicates the uchScanCode value is valid;
                             otherwise, uchScanCode contains zero.
                             Generally, all WM_CHAR messages generated from
                             actual user input have the KC_SCANCODE flag
                             set. However, if the message has been generated
                             by an application that has issued the
                             WinSetHook function to filter keystrokes, or
                             been posted to the application queue, this code
                             may not be set.
 
             KC_VIRTUALKEY   Indicates the usVKey value is valid; otherwise,
                             usVKey contains zero.
 
             KC_KEYUP        The event was a key-up transition; otherwise,
                             it was a key-down transition.
 
             KC_PREVDOWN     The key was previously down; otherwise, it was
                             previously up.
 
             KC_DEADKEY      The character code is a dead key. The
                             application displays the glyph for the dead key
                             without advancing the cursor.
 
             KC_COMPOSITE    The character code was formed by combining the
                             current key with the previous dead key.
 
             KC_INVALIDCOMP  The character code was not a valid combination
                             with the preceding dead key. The application
                             advances the cursor past the dead-key glyph and
                             then, if the current character is not a space,
                             it beeps the speaker and displays the new
                             character code.
 
             KC_LONEKEY      This bit is set if the key was pressed and
                             released without any other keys being pressed
                             or released between the time the key went down
                             and went up.
 
             KC_SHIFT        The SHIFT state was active when the key was
                             pressed or released.
 
             KC_ALT          The ALT state was active when the key was
                             pressed or released.
 
             KC_CTRL         The CONTROL state was active when the key was
                             pressed or released.
 
uchRepeat    Low byte of the high word of mp1. Specifies the repeat count of
             the key.
 
uchScanCode  High byte of the high word of mp1. Specifies the scan code of
             the character.
 
uchChr       Low word of mp2. Specifies the ASCII character.
 
uchKbdScan   High byte of low word of mp2. Specifies the keyboard scan
             code.
 
Return Value
 
The application should return TRUE if it processes the message. Otherwise,
it should return FALSE.
 
See Also
 
WinSetHook, CHARMSG, WM_CHAR