2021-07-24 21:11:47 -07:00

23 lines
1.3 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* ------------------------------- msgpack.h -------------------------------- */
/*------------------------------------------------------------------------------
Selected message unpacking macros from windowsx.h
to circumvent compile-time memory headaches.
------------------------------------------------------------------------------*/
#ifdef WIN32
#define GET_WM_ACTIVATE_STATE(wp, lp) LOWORD(wp)
#define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp)
#define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
#define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp)
#define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
(void)(fn)((hwnd), WM_COMMAND, MAKEWPARAM((UINT)(id),(UINT)(codeNotify)), (LPARAM)(HWND)(hwndCtl))
/* -------------------------------------------------------------------------- */
#else
#define GET_WM_ACTIVATE_STATE(wp, lp) (wp)
#define GET_WM_COMMAND_ID(wp, lp) (wp)
#define GET_WM_COMMAND_HWND(wp, lp) (HWND)LOWORD(lp)
#define GET_WM_COMMAND_CMD(wp, lp) HIWORD(lp)
#define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
(void)(fn)((hwnd), WM_COMMAND, (WPARAM)(int)(id), MAKELPARAM((UINT)(hwndCtl), (codeNotify)))
/* -------------------------------------------------------------------------- */
#endif