LOWORD and HIWORD Functions in C/C++: Extracting 16-bit Values from a 32-bit Parameter
LOWORD(lParam) returns the lower 16 bits of the lParam parameter, while HIWORD(lParam) returns the higher 16 bits of the lParam parameter.
These functions are commonly used in Windows programming, particularly when working with messages. The lParam parameter often contains data in a 32-bit format, and using LOWORD and HIWORD allows you to extract specific parts of this data.
Example:
// Assume lParam holds a 32-bit value
WORD low = LOWORD(lParam);
WORD high = HIWORD(lParam);
By using these functions, you can effectively manipulate and interpret the data contained within the lParam parameter.
原文地址: https://www.cveoy.top/t/topic/qjE5 著作权归作者所有。请勿转载和采集!