MAKELOG&MAKEWORD&POINT转换的应用

#define MAKEWORD(a, b)      ((WORD)(((BYTE)(((DWORD_PTR)(a)) & 0xff)) | ((WORD)((BYTE)(((DWORD_PTR)(b)) & 0xff))) << 8))

#define MAKELONG(a, b)      ((LONG)(((WORD)(((DWORD_PTR)(a)) & 0xffff)) | ((DWORD)((WORD)(((DWORD_PTR)(b)) & 0xffff))) << 16))

#define LOWORD(l)           ((WORD)(((DWORD_PTR)(l)) & 0xffff))

#define HIWORD(l)           ((WORD)((((DWORD_PTR)(l)) >> 16) & 0xffff))

#define LOBYTE(w)           ((BYTE)(((DWORD_PTR)(w)) & 0xff))

#define HIBYTE(w)           ((BYTE)((((DWORD_PTR)(w)) >> 8) & 0xff))



POINT point = {LOWORD(lParam),HIWORD(lParam)};

(LPARAM)(DWORD)MAKELONG(pt.x, pt.y)

本文出自 “BaggerSky” 博客,谢绝转载!

你可能感兴趣的:(转换应用)