home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************
- *
- * WEventGeneratorSpy
- *
- *************************************************************************/
-
- #ifndef _WEVENTSP_HPP_INCLUDED
- #define _WEVENTSP_HPP_INCLUDED
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #ifndef _WEVENT_HPP_INCLUDED
- #include "wevent.hpp"
- #endif
-
- #define WSpyEvent WNotifyEvent
-
- struct WCMCLASS WSpyEventData : public WEventData {
- WBool isBefore; // set to TRUE before event is called, FALSE after
- WBool wasHandled; // after event is called, indicates if was handled
- WBool eatEvent; // before event is called, set to TRUE to cancel
- WEventData *eventData; // actual event data that is being passed
- };
-
- class WCMCLASS WEventGeneratorSpy : public WEventGenerator {
-
- friend class WEventGenerator;
-
- public:
- static WEventGeneratorSpy *GetSpy();
- static WBool CanSpy( const WObject *o );
- static const WChar *EventName( WEventID id, const WChar *unknownName=NULL );
-
- protected:
- WEventGeneratorSpy();
-
- virtual void EventNotice( WEventID id, WEventNotice type );
-
- public:
- virtual ~WEventGeneratorSpy();
-
- private:
- static WEventGeneratorSpy _spy;
- static WBool _canSpy;
- };
-
-
- struct WSpyDLLParameters {
- WWindow * window; // Window that the spy message was sent to
- WMessage message;
- };
-
- /*************************************************************************
- *
- * WSpyDLL -- provides a mechanism to load .dll's into running Optima++
- * applications.
- *
- *
- * A Spy DLL should have an entry point of the form
- *
- * extern "C" __declspec(dllexport)
- * WLong __stdcall WSpyDLLEntryPoint( WSpyDLLParameters & );
- *
- * The WLong that this entry point returns is the return value of
- * SendSpyLoadDLLMessage.
- *
- *************************************************************************/
-
- typedef WLong __stdcall (*WSpyDLLEntryPointFN)( WSpyDLLParameters & parameters );
- #define WSPYDLLENTRYPOINT WTEXT("_WSpyDLLEntryPoint@4")
-
- class WCMCLASS WSpyDLL : public WObject {
- public:
- /**************************************************************
- * Properties
- **************************************************************/
-
- //
- // AllowSpyDLLLoad
- //
- // If TRUE, this allows other applications to load a .dll
- // into
-
- static WBool GetAllowSpyDLLLoad();
- static WBool SetAllowSpyDLLLoad( WBool allow );
-
- /**************************************************************
- * Methods
- **************************************************************/
-
- //
- // BroadcastSpyLoadDLLMessage
- //
- // Request that a dll specified by 'dll' be loaded into all
- // Optima++ windowed applications. The WSpyDLLEntryPoint
- // function will be called once for each top-level window
- // in each Optima++ application.
-
- static WLong BroadcastSpyLoadDLLMessage( const WString & dll );
-
- //
- // SendSpyLoadDLLMessage
- //
- // Send a message to a particular window to load a spy dll.
- // Call the WSpyDLLEntryPoint function in the remote process,
- // and return the WLong result.
-
- static WLong SendSpyLoadDLLMessage( WWindowHandle win, const WString & dll );
-
- public:
- /**************************************************************
- * Internal
- **************************************************************/
-
- static WLong ExecuteSpyMessage( WWindow *, const WMessage & );
- private:
- static WBool _allowSpyDLLLoad;
- };
-
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WEVENTSP_HPP_INCLUDED
-