tune description of MSG_CHAR

This commit is contained in:
VincentWei
2018-02-02 12:18:11 +08:00
parent 7c9fb6e4f7
commit e2c2ac0704
2 changed files with 16 additions and 3 deletions
+14 -1
View File
@@ -104,7 +104,7 @@ The main changes in structure and functions:
##### Message
As a result, the strcuture `MSG` and all message-related functions changed.
The strcuture `MSG` and all message-related functions changed.
For example, the prototype of `SendMessage` changed from
int SendMessage (HWND hWnd, int nMsg, WPARAM wParam, LPARAM lParam)
@@ -113,6 +113,19 @@ to
LRESULT SendMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
_IMPORTANT NOTE_
For best portability, you should use `LOBYTE_WORD16` and `HIBYTE_WORD16`
to get the bytes of a character when you extract the bytes from `WPARAM`
parameter of a `MSG_CHAR` message:
MSG_CHAR
WORD16 ch = (WORD16)wParam;
DWORD key_flags = (DWORD)lParam;
byte0 = LOBYTE_WORD16 (ch);
byte1 = HIBYTE_WORD16 (ch);
##### Window callback procedure
Furthermore, the structure and functions to register window class,
+2 -2
View File
@@ -420,11 +420,11 @@ extern "C" {
*
* \code
* MSG_CHAR
* int ch = (int)wParam;
* WORD16 ch = (WORD16)wParam;
* DWORD key_flags = (DWORD)lParam;
* \endcode
*
* \param ch The ASCII code of the pressed key.
* \param ch The EUC code of the pressed key.
* \param key_flags The shift key status when this message occurred.
*
* \note Please use \a LOBYTE_WORD16 and \a HIBYTE_WORD16 to get the bytes