home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************
- *
- * WMessage --
- *
- *************************************************************************/
-
- #ifndef _WMESSAGE_HPP_INCLUDED
- #define _WMESSAGE_HPP_INCLUDED
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #ifndef _WDEF_HPP_INCLUDED
- # include "wdef.hpp"
- #endif
- #ifndef _WEVENTD_HPP_INCLUDED
- # include "weventd.hpp"
- #endif
-
- //
- // WMessage -- A convenience class for encapsulating window messages.
- //
-
- class WCMCLASS WMessage {
-
- public:
-
- /**********************************************************
- * Constructors and destructors
- *********************************************************/
-
- // Construct & destruct
-
- WMessage()
- : hWnd( 0 ), msg( 0 ),
- wParam( 0 ), lParam( 0 ), time( 0 ), pt( 0, 0 ) {}
- WMessage( WUInt m, WUInt w, WLong l )
- : hWnd( 0 ), msg( m ),
- wParam( w ), lParam( l ), time( 0 ), pt( 0, 0 ) {}
- WMessage( WWindowHandle h, WUInt m, WUInt w, WLong l )
- : hWnd( h ), msg( m ),
- wParam( w ), lParam( l ), time( 0 ), pt( 0, 0 ) {}
- WMessage( WWindowHandle h, WUInt m, WUInt w, WLong l,
- WDWord t, const WPoint & p )
- : hWnd( h ), msg( m ),
- wParam( w ), lParam( l ), time( t ), pt( p ) {}
-
- ~WMessage() {}
-
- /**********************************************************
- * Properties
- *********************************************************/
-
- WUShort GetControlID() const;
- WWindowHandle GetControlHandle() const;
- WInt GetCommandCode() const;
- WUShort GetMenuFlags() const;
- WMenuHandle GetMenuHandle() const;
- WUShort GetMenuID() const;
- WBool GetMenuClosed() const;
-
- /**********************************************************
- * Methods
- *********************************************************/
-
- /**********************************************************
- * Data members
- *********************************************************/
-
- // Data that describes the message... exposed for quick access.
- // This is very system-specific!
- // NOTE: Only msg, wParam, and lParam are always set;
- // periodically, hWnd, time and pt will remain unset
-
- WWindowHandle hWnd;
- WUInt msg;
- WUInt wParam;
- WLong lParam;
- WDWord time;
- WPoint pt;
- };
-
- //
- // WMessageHookEventData
- //
-
- struct WMessageHookEventData : public WEventData {
- WMessage message;
- WLong returns;
- };
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WMESSAGE_HPP_INCLUDED
-