1 ///////////////////////////////////////////////////////////////////////////////
2 // $Source: x:/prj/tech/libsrc/appcore/RCS/wappcore.h $
4 // $Date: 1997/08/05 13:13:27 $
19 ///////////////////////////////////////////////////////////////////////////////
21 F_DECLARE_INTERFACE(IAggregate
);
23 ///////////////////////////////////////////////////////////////////////////////
25 // class cWindowsApplication
27 // Implements IApplication and IWinApp
30 class cWindowsApplication
33 cWindowsApplication(int argc
, const char *argv
[],
35 IUnknown
* pOuterUnknown
);
38 // Command line values
44 ///////////////////////////////////////////////////////////////////////////
46 // class cWindowsApplication::cWinAppOperations
48 // Implements IWinApp on behalf of outer class
50 class cWinAppOperations
: public IWinApp
54 cWinAppOperations(cWindowsApplication
* pWindowsApplication
, IUnknown
* pOuterUnknown
)
55 : m_pWindowsApplication(pWindowsApplication
), m_fFlags(0)
57 INIT_DELEGATION(pOuterUnknown
);
60 STDMETHOD_(HWND
, GetMainWnd
)();
61 STDMETHOD_(HWND
, SetMainWnd
)(HWND
);
63 STDMETHOD_(HINSTANCE
, GetInstance
)();
64 STDMETHOD_(HINSTANCE
, GetResourceInstance
)();
66 STDMETHOD_(const char *, GetCommandLine
)();
67 STDMETHOD_(int, GetCommandShow
)();
69 STDMETHOD_(void, SetRegistryKey
)(const char *);
70 STDMETHOD_(const char *, GetRegistryKey
)();
72 STDMETHOD_(void, SetProfileName
)(const char *);
73 STDMETHOD_(const char *, GetProfileName
)();
75 STDMETHOD_(void, SetDialogBkColor
)(COLORREF clrCtlBk
/* = RGB(192, 192, 192)*/,
76 COLORREF clrCtlText
/* = RGB(0, 0, 0)*/ );
78 STDMETHOD_(eWinPumpResult
, PumpEvents
)(int fPumpFlags
, eWinPumpDuration fDuration
);
80 STDMETHOD (ModalDialogBox
)(LPCTSTR lpTemplate
, DLGPROC lpDialogFunc
);
82 DECLARE_CONNECTION_POINT(IWinAppAdviseSink
);
85 eWinPumpResult
DispatchOneMessage(MSG
*, unsigned, unsigned);
86 int PreTranslateMessage(MSG
*);
96 cWindowsApplication
* m_pWindowsApplication
;
99 cWinAppOperations m_WinAppOperations
;
101 ///////////////////////////////////////////////////////////////////////////
103 // class cWindowsApplication::cApplicationOperations
105 // Implements IApplication on behalf of outer class
107 class cApplicationOperations
: public IApplication
109 DECLARE_DELEGATION();
111 cApplicationOperations(cWindowsApplication
* pWindowsApplication
, IUnknown
* pOuterUnknown
)
112 : m_pWindowsApplication(pWindowsApplication
)
114 INIT_DELEGATION(pOuterUnknown
);
117 STDMETHOD (QueryQuit
)();
118 STDMETHOD_(void, Quit
)();
119 STDMETHOD_(void, Abort
)(const char * pszReason
);
121 STDMETHOD_(void, SetCaption
)(const char *);
122 STDMETHOD_(const char *, GetCaption
)();
124 STDMETHOD_(void, SetDefaultFilePath
)(const char *);
125 STDMETHOD_(const char *, GetDefaultFilePath
)();
127 STDMETHOD_(const char *, GetFullName
)();
128 STDMETHOD_(const char *, GetPath
)();
130 STDMETHOD_(int, MessageBox
)(const char * pszMessage
, const char * pszCaption
, int fFlags
);
131 STDMETHOD_(int, CriticalMessageBox
)(const char * pszMessage
, const char * pszCaption
, int errorCode
);
133 DECLARE_CONNECTION_POINT(IAppAdviseSink
);
135 STDMETHOD_(void, AppCommand
)(unsigned nCmdId
);
138 cWindowsApplication
* m_pWindowsApplication
;
141 cApplicationOperations m_ApplicationOperations
;
143 friend class cWinAppOperations
;
144 friend class cApplicationOperations
;
146 DECLARE_SIMPLE_AGGREGATE_CONTROL(cWindowsApplication
);
149 #endif /* !__WAPPCORE_H */