Leaked source code of windows server 2003
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.

85 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. HWND m_hAppWnd; // main window handle
  17. HINSTANCE m_hInst; // application instance
  18. BOOL m_fStartByOle; // TRUE if app started by OLE
  19. DWORD m_dwRegisterClass; // returned by RegisterClassFactory
  20. HMENU m_hMainMenu;
  21. HMENU m_hColorMenu;
  22. HMENU m_hHelpMenu;
  23. LPOLEOBJECT m_OleObject; // pointer to "dummy" object
  24. CSimpSvrDoc FAR * m_lpDoc; // pointer to document object
  25. BOOL m_fInitialized; // OLE initialization flag
  26. RECT nullRect; // used in inplace negotiation
  27. public:
  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. long 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. // Utility functions
  43. void ParseCmdLine(LPSTR lpCmdLine);
  44. void SetStatusText();
  45. BOOL IsInPlaceActive();
  46. void ShowAppWnd(int nCmdShow=SW_SHOWNORMAL);
  47. void HideAppWnd();
  48. // member variable access
  49. inline HWND GethAppWnd() { return m_hAppWnd; };
  50. inline HINSTANCE GethInst() { return m_hInst; };
  51. inline BOOL IsStartedByOle() { return m_fStartByOle; };
  52. inline BOOL IsInitialized() { return m_fInitialized; };
  53. inline DWORD GetRegisterClass() { return m_dwRegisterClass; };
  54. inline CSimpSvrDoc FAR * GetDoc() { return m_lpDoc; };
  55. inline void ClearDoc() { m_lpDoc = NULL; };
  56. inline LPOLEOBJECT GetOleObject() { return m_OleObject; };
  57. inline HMENU GetMainMenu() { return m_hMainMenu; };
  58. inline HMENU GetColorMenu() { return m_hColorMenu; };
  59. inline HMENU GetHelpMenu() { return m_hHelpMenu; } ;
  60. friend interface CClassFactory; // make the contained class a friend
  61. };
  62. #endif