Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
1.3 KiB

  1. /* ------------------------------- msgpack.h -------------------------------- */
  2. /*------------------------------------------------------------------------------
  3. Selected message unpacking macros from windowsx.h
  4. to circumvent compile-time memory headaches.
  5. ------------------------------------------------------------------------------*/
  6. #ifdef WIN32
  7. #define GET_WM_ACTIVATE_STATE(wp, lp) LOWORD(wp)
  8. #define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp)
  9. #define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
  10. #define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp)
  11. #define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
  12. (void)(fn)((hwnd), WM_COMMAND, MAKEWPARAM((UINT)(id),(UINT)(codeNotify)), (LPARAM)(HWND)(hwndCtl))
  13. /* -------------------------------------------------------------------------- */
  14. #else
  15. #define GET_WM_ACTIVATE_STATE(wp, lp) (wp)
  16. #define GET_WM_COMMAND_ID(wp, lp) (wp)
  17. #define GET_WM_COMMAND_HWND(wp, lp) (HWND)LOWORD(lp)
  18. #define GET_WM_COMMAND_CMD(wp, lp) HIWORD(lp)
  19. #define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
  20. (void)(fn)((hwnd), WM_COMMAND, (WPARAM)(int)(id), MAKELPARAM((UINT)(hwndCtl), (codeNotify)))
  21. /* -------------------------------------------------------------------------- */
  22. #endif
  23.