Page 116 - DCAP408_WEB_PROGRAMMING
P. 116
Windows Programming
Notes Self Assessment
Fill in the blanks:
5. ......................... message is posted to the window with the keyboard focus when a
WM_KEYDOWN message is converted by the Translate Message function.
6. ......................... is the character code of the key.
7.5 System Key Messages and Dead Characters
Some non-English keyboards enclose character keys that are not predictable to generate characters
by themselves. Rather, they are used to add a diacritic to the character generated by the consequent
keystroke. These keys are known as dead keys.
Example: The circumflex key on a German keyboard is an example of a dead key.
To enter the character including an “o” with a circumflex, a German user would type the circumflex
key followed by the “o” key. The window with the keyboard focus would obtain the following
series of messages:
WM_KEYDOWN
WM_DEADCHAR
WM_KEYUP
WM_KEYDOWN
WM_CHAR
WM_KEYUP
TranslateMessage produces the WM_DEADCHAR message when it processes the
WM_KEYDOWN message from a dead key. Even though the wParam parameter of the
WM_DEADCHAR message includes the character code of the diacritic for the dead key, an
application usually overlooks the message. Rather, it processes the WM_CHAR message
produced by the subsequent keystroke. The wParam parameter of the WM_CHAR message
comprises the character code of the letter with the diacritic. If the subsequent keystroke produces
a character that cannot be combined with a diacritic, Windows produces two WM_CHAR
messages. The wParam parameter of the first comprises the character code of the diacritic; the
wParamparameter of the second includes the character code of the subsequent character key.
The TranslateMessage function produces the WM_SYSDEADCHAR message when it processes
the WM_SYSKEYDOWN message from a system dead key (a dead key that is pressed in
amalgamation with the ALT key).
Did u know? An application in general overlooks the WM_SYSDEADCHAR message.
Self Assessment
Fill in the blank:
7. TranslateMessage produces the WM_DEADCHAR message when it processes the
WM_KEYDOWN message from a ......................... key.
110 LOVELY PROFESSIONAL UNIVERSITY