what this does
-
HI ALL My question about HIWORD and LOWORD ? I'm always see LOWORD (wParam) // in WndProc function some Data Types like WPARAM , LPARAM ,DWORD have LOWORD and HIWORD value I found in MSDN about HIWORD and LOWORD it tell me it's macros like #define HIWORD(l) ((WORD) (((DWORD) (l) >> 16) & 0xFFFF)) #define LOWORD(l) ((WORD) (l)) but I can't understand what this mean and what this does can you tell me please ...
-
HI ALL My question about HIWORD and LOWORD ? I'm always see LOWORD (wParam) // in WndProc function some Data Types like WPARAM , LPARAM ,DWORD have LOWORD and HIWORD value I found in MSDN about HIWORD and LOWORD it tell me it's macros like #define HIWORD(l) ((WORD) (((DWORD) (l) >> 16) & 0xFFFF)) #define LOWORD(l) ((WORD) (l)) but I can't understand what this mean and what this does can you tell me please ...
Thats simple: usually u use a command like (HIWORD)(lParam) ! That means you want to have the upper 16 Bit from 32. To get them you have to shift right 16 (>>16) times and mask out the upper 16 Bit ( & 0x0000ffff ). To get (LOWORD)(lParam) you have to clear the upper 16 Bit. Converting to a new type WORD from DWORD takes only the lower 16 Bit. The effect is the same. Hope it helps Greatings Mario/// -------------------- www.klangwerker.de rocknix@lycos.de --------------------