home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / hpp.z / WMESSAGE.HPP < prev    next >
C/C++ Source or Header  |  1996-10-18  |  3KB  |  92 lines

  1. /*************************************************************************
  2.  *
  3.  * WMessage --
  4.  *
  5.  *************************************************************************/
  6.  
  7. #ifndef _WMESSAGE_HPP_INCLUDED
  8. #define _WMESSAGE_HPP_INCLUDED
  9.  
  10. #ifndef _WNO_PRAGMA_PUSH
  11. #pragma pack(push,8);
  12. #pragma enum int;
  13. #endif
  14.  
  15. #ifndef _WDEF_HPP_INCLUDED
  16. #  include "wdef.hpp"
  17. #endif
  18. #ifndef _WEVENTD_HPP_INCLUDED
  19. #  include "weventd.hpp"
  20. #endif
  21.  
  22. //
  23. // WMessage -- A convenience class for encapsulating window messages.
  24. //
  25.  
  26. class WCMCLASS WMessage {
  27.  
  28.     public:
  29.  
  30.         /**********************************************************
  31.          * Constructors and destructors
  32.          *********************************************************/
  33.     
  34.         // Construct & destruct
  35.     
  36.         WMessage();
  37.         WMessage( WUInt msg, WUInt wParam, WLong lParam );
  38.         WMessage( WWindowHandle hWnd, WUInt msg, WUInt wParam, WLong lParam );
  39.         WMessage( WWindowHandle hWnd, WUInt msg, WUInt wParam, WLong lParam,
  40.                   WDWord time, const WPoint & pt );
  41.     
  42.         ~WMessage();
  43.     
  44.         /**********************************************************
  45.          * Properties
  46.          *********************************************************/
  47.     
  48.         WUShort         GetControlID() const;
  49.         WWindowHandle   GetControlHandle() const;
  50.         WInt            GetCommandCode() const;
  51.         WUShort         GetMenuFlags() const;
  52.         WMenuHandle     GetMenuHandle() const;
  53.         WUShort         GetMenuID() const;
  54.         WBool           GetMenuClosed() const;
  55.  
  56.         /**********************************************************
  57.          * Methods
  58.          *********************************************************/
  59.     
  60.         /**********************************************************
  61.          * Data members
  62.          *********************************************************/
  63.     
  64.         // Data that describes the message... exposed for quick access.
  65.         // This is very system-specific!
  66.         // NOTE: Only msg, wParam, and lParam are always set;
  67.         //       periodically, hWnd, time and pt will remain unset
  68.     
  69.         WWindowHandle           hWnd;
  70.         WUInt                   msg;
  71.         WUInt                   wParam;
  72.         WLong                   lParam;
  73.         WDWord                  time;
  74.         WPoint                  pt;
  75. };
  76.  
  77. //
  78. // WMessageHookEventData
  79. //
  80.  
  81. struct WMessageHookEventData : public WEventData {
  82.     WMessage            message;
  83.     WLong               returns;
  84. };
  85.  
  86. #ifndef _WNO_PRAGMA_PUSH
  87. #pragma enum pop;
  88. #pragma pack(pop);
  89. #endif
  90.  
  91. #endif // _WMESSAGE_HPP_INCLUDED
  92.