home *** CD-ROM | disk | FTP | other *** search
- // baseview.hpp
- //
- // Created 10/07/98
- //
- // (C)Copyright 1998-1999 Microsoft Corporation, All rights reserved.
- //
-
- #ifndef __BASEVIEW_HPP__
- #define __BASEVIEW_HPP__
-
- #include "hpmnclnt.hpp"
- #include "guids.h"
-
- class HeapMonitorManager;
-
-
- enum BasicClientWindowMessages
- {
- WM_BC_FIRST = WM_USER,
-
- WM_BC_DESTROY_NOW = WM_BC_FIRST,
-
- WM_BC_LAST,
- };
-
-
- class BasicClient : public IHeapMonitorClient
- {
- private:
-
- ULONG m_RefCount;
-
- protected:
-
- HeapMonitorManager *m_mgr;
-
- HWND m_hwnd;
-
-
- //------------------------------------------------------------------------
- // UI stuff
-
- static LRESULT CALLBACK BaseWndProc (HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam);
-
- virtual BOOL OnCreateWindow () = 0;
-
-
- //------------------------------------------------------------------------
-
- BasicClient ();
- virtual ~BasicClient ();
-
- // Creates a MDI client window
- BOOL BasePreInitialize (HeapMonitorManager *mgr, PCSTR wndclsname, PCSTR wndtitle);
- BOOL BasePostInitialize (HeapMonitorClientRegistrationInfo *preginfo);
-
- BOOL BaseInitialize (HeapMonitorManager *mgr, PCSTR wndclsname, PCSTR wndtitle, HeapMonitorClientRegistrationInfo *preginfo)
- {
- return BasePreInitialize(mgr, wndclsname, wndtitle)
- && BasePostInitialize(preginfo);
- }
-
-
- //------------------------------------------------------------------------
-
- public:
-
- // IUnknown methods
-
- ULONG STDMETHODCALLTYPE AddRef (VOID);
- ULONG STDMETHODCALLTYPE Release (VOID);
- STDMETHODIMP QueryInterface (REFIID riid, PVOID *ppvObj);
-
- // IHeapMonitorClient methods
-
- STDMETHODIMP OnClose ()
- {
- SendMessage(m_hwnd, WM_CLOSE, 0, 0);
- return S_OK;
- }
- };
-
-
-
- #endif /* __BASEVIEW_HPP__ */
-
-