*/}}
1
0

msgdef.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*----------------------------------------------------------------------------s
  2. NAME
  3. MSGPACK.H
  4. PURPOSE
  5. Selected message unpacking macros from windowsx.h
  6. to circumvent compile-time memory headaches.
  7. COPYRIGHT
  8. This file is Copyright (c) Wacom Company, Ltd. 2020 All Rights Reserved
  9. with portions copyright 1991-1998 by LCS/Telegraphics.
  10. The text and information contained in this file may be freely used,
  11. copied, or distributed without compensation or licensing restrictions.
  12. ---------------------------------------------------------------------------- */
  13. #pragma once
  14. #ifdef WIN32
  15. #define GET_WM_ACTIVATE_STATE(wp, lp) LOWORD(wp)
  16. #define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp)
  17. #define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
  18. #define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp)
  19. #define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
  20. (void)(fn)((hwnd), WM_COMMAND, MAKEWPARAM((UINT)(id),(UINT)(codeNotify)), (LPARAM)(HWND)(hwndCtl))
  21. /* -------------------------------------------------------------------------- */
  22. #else
  23. #define GET_WM_ACTIVATE_STATE(wp, lp) (wp)
  24. #define GET_WM_COMMAND_ID(wp, lp) (wp)
  25. #define GET_WM_COMMAND_HWND(wp, lp) (HWND)LOWORD(lp)
  26. #define GET_WM_COMMAND_CMD(wp, lp) HIWORD(lp)
  27. #define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
  28. (void)(fn)((hwnd), WM_COMMAND, (WPARAM)(int)(id), MAKELPARAM((UINT)(hwndCtl), (codeNotify)))
  29. /* -------------------------------------------------------------------------- */
  30. #endif