use HIBYTE_WORD16/LOBYTE_WORD16 to extract bytes from wParam of MSG_CHAR

This commit is contained in:
VincentWei
2018-02-02 12:07:08 +08:00
parent c6c60b862b
commit 7c9fb6e4f7
7 changed files with 16 additions and 16 deletions
+3 -3
View File
@@ -2474,14 +2474,14 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if (dwStyle & ES_READONLY)
return 0;
charBuffer [0] = LOBYTE (wParam);
charBuffer [1] = HIBYTE (wParam);
charBuffer [0] = LOBYTE_WORD16 (wParam);
charBuffer [1] = HIBYTE_WORD16 (wParam);
charBuffer [2] = (0x00ff0000 & wParam) >> 16;
if (charBuffer [2]) {
chars = 3;
}
else if (HIBYTE (wParam)) {
else if (HIBYTE_WORD16 (wParam)) {
chars = 2;
}
else {
+3 -3
View File
@@ -816,12 +816,12 @@ static LRESULT ButtonCtrlProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
break;
case MSG_CHAR:
if (HIBYTE (wParam)==0 && BUTTON_IS_CHECKBTN (pctrl)) {
if (HIBYTE_WORD16 (wParam)==0 && BUTTON_IS_CHECKBTN (pctrl)) {
int old_check = BUTTON_GET_CHECK(pctrl);
if (LOBYTE(wParam) == '+' || LOBYTE(wParam) == '=')
if (LOBYTE_WORD16(wParam) == '+' || LOBYTE_WORD16(wParam) == '=')
BUTTON_SET_CHECK(pctrl, BST_CHECKED);
else if (LOBYTE(wParam) == '-')
else if (LOBYTE_WORD16(wParam) == '-')
BUTTON_SET_CHECK(pctrl, BST_UNCHECKED);
if (old_check != BUTTON_GET_CHECK(pctrl))
+3 -3
View File
@@ -2081,14 +2081,14 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if (dwStyle & ES_READONLY)
return 0;
charBuffer [0] = LOBYTE (wParam);
charBuffer [1] = HIBYTE (wParam);
charBuffer [0] = LOBYTE_WORD16 (wParam);
charBuffer [1] = HIBYTE_WORD16 (wParam);
charBuffer [2] = (0x00ff0000 & wParam) >> 16;
if (charBuffer [2]) {
chars = 3;
}
else if (HIBYTE (wParam)) {
else if (HIBYTE_WORD16 (wParam)) {
chars = 2;
}
else {
+2 -2
View File
@@ -1885,10 +1885,10 @@ static LRESULT ListboxCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM l
int newTop;
PLISTBOXITEM plbi;
if (HIBYTE (wParam))
if (HIBYTE_WORD16 (wParam))
break;
head [0] = LOBYTE (wParam);
head [0] = LOBYTE_WORD16 (wParam);
head [1] = '\0';
pData = (PLISTBOXDATA)pCtrl->dwAddData2;
+1 -1
View File
@@ -62,7 +62,7 @@ static void output_gbhz_py_tab (void)
int j;
GBHZ_PINYIN* p = gbhz_py_tab + i;
printf ("\t{0x%04X /* %c%c */, 0, {", p->encoding, HIBYTE (p->encoding), LOBYTE (p->encoding));
printf ("\t{0x%04X /* %c%c */, 0, {", p->encoding, HIBYTE_WORD16 (p->encoding), LOBYTE_WORD16 (p->encoding));
for (j = 0; j < MAX_NR_PINYIN; j++) {
int no_py, tone;
if (p->pinyin [j] == 0)
+2 -2
View File
@@ -816,9 +816,9 @@ static LRESULT MsgBoxProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
{
int id = 0;
if (HIBYTE (wParam))
if (HIBYTE_WORD16 (wParam))
break;
switch (LOBYTE (wParam)) {
switch (LOBYTE_WORD16 (wParam)) {
case 'Y':
case 'y':
id = IDYES;
+2 -2
View File
@@ -4327,8 +4327,8 @@ static int mTextEditor_onChar(mTextEditor *self, int asciiCode, DWORD keyFlags)
return 0;
}
ch [0] = LOBYTE (asciiCode);
ch [1] = HIBYTE (asciiCode);
ch [0] = LOBYTE_WORD16 (asciiCode);
ch [1] = HIBYTE_WORD16 (asciiCode);
ch [2] = (0x0ff0000 & asciiCode) >> 16;
if (ch[2]) {
chlen = 3;