|
| Hello,
I am reviewing some code examples when I discovered something. It concerns
the following code fragment:
TextOut(hdc,0, (cyClient / cyChar -1 -i) * cyChar, szBuffer,
wsprintf(szBuffer,szFormat[iType],
szMessage [pmsg[i].message - WM_KEYFIRST],
pmsg[i].wParam,
(PTSTR) (iType ? TEXT (" ") : szKeyName),
(TCHAR) (iType ? pmsg[i].wParam : ' '),
LOWORD (pmsg[i].lParam),
HIWORD (pmsg[i].lParam) & 0xFF,
0x01000000 & pmsg[i].lParam ? szYes : szNo,
0x20000000 & pmsg[i].lParam ? szYes : szNo,
0x40000000 & pmsg[i].lParam ? szDown : szUp,
0x80000000 & pmsg[i].lParam ? szUp : szDown));
The understanding of what the code fragment does is not the issue! It is
more to do with the following two lines of the code fragment:
szMessage [pmsg[i].message - WM_KEYFIRST],
AND
(TCHAR) (iType ? pmsg[i].wParam : ' '),
Lets say I strored the character 'I' (WHILE CAPS LOCK OFF = 'i') in wParam
of the pmsg structure! Why is it, that when I hold my cursor over the pmsg
part of the following line:
szMessage [pmsg[i].message - WM_KEYFIRST],
that I get the value of 69 which is the hex value of 'i', and when I hold my
cursor over the wParam part of the following line:
(TCHAR) (iType ? pmsg[i].wParam : ' '),
I get 105 which is the decimal value of 'i'.
Why one comes out in hex and the other in decimal, why must we confuse life!
Or maybe is there some setting that I can instruct VC++ to view it all in
say decimal? I mean, regardless where you view lParam, its always a long
integer
right!
Just currious!
Ross!
|
|