Source code of Windows XP (NT5)
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.

87 lines
2.6 KiB

  1. //**********************************************************************
  2. // File name: app.h
  3. //
  4. // Definition of CSimpSvrApp
  5. //
  6. // Copyright (c) 1993 Microsoft Corporation. All rights reserved.
  7. //**********************************************************************
  8. #if !defined( _APP_H_)
  9. #define _APP_H_
  10. class CSimpSvrDoc;
  11. interface CClassFactory;
  12. class CSimpSvrApp : public IUnknown
  13. {
  14. private:
  15. int m_nCount; // reference count
  16. HINSTANCE m_hInst; // application instance
  17. BOOL m_fStartByOle; // TRUE if app started by OLE
  18. DWORD m_dwRegisterClass; // returned by RegisterClassFactory
  19. LPOLEOBJECT m_OleObject; // pointer to "dummy" object
  20. CSimpSvrDoc FAR * m_lpDoc; // pointer to document object
  21. BOOL m_fInitialized; // OLE initialization flag
  22. RECT nullRect; // used in inplace negotiation
  23. // Convert to/from owner draw menus
  24. void HandleChangeColors(void);
  25. public:
  26. HWND m_hAppWnd; // main window handle
  27. HACCEL m_hAccel; // Accelerators
  28. // IUnknown Interfaces
  29. STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj);
  30. STDMETHODIMP_(ULONG) AddRef();
  31. STDMETHODIMP_(ULONG) Release();
  32. // Initialization methods
  33. CSimpSvrApp(); // Constructor
  34. ~CSimpSvrApp(); // Destructor
  35. BOOL fInitApplication (HANDLE hInstance);
  36. BOOL fInitInstance (HANDLE hInstance, int nCmdShow, CClassFactory FAR * lpClassFactory);
  37. // Message handling methods
  38. LRESULT lCommandHandler (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  39. long lSizeHandler (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  40. long lCreateDoc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  41. void PaintApp(HDC hDC);
  42. void HandleDrawItem(LPDRAWITEMSTRUCT lpdis);
  43. // Utility functions
  44. void ParseCmdLine(LPSTR lpCmdLine);
  45. void SetStatusText();
  46. BOOL IsInPlaceActive();
  47. void ShowAppWnd(int nCmdShow=SW_SHOWNORMAL);
  48. void HideAppWnd();
  49. // member variable access
  50. inline HWND GethAppWnd() { return m_hAppWnd; };
  51. inline HINSTANCE GethInst() { return m_hInst; };
  52. inline BOOL IsStartedByOle() { return m_fStartByOle; };
  53. inline BOOL IsInitialized() { return m_fInitialized; };
  54. inline DWORD GetRegisterClass() { return m_dwRegisterClass; };
  55. inline CSimpSvrDoc FAR * GetDoc() { return m_lpDoc; };
  56. inline void ClearDoc() { m_lpDoc = NULL; };
  57. inline LPOLEOBJECT GetOleObject() { return m_OleObject; };
  58. friend interface CClassFactory; // make the contained class a friend
  59. };
  60. #endif