home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / winui / shell / regview / dockwndw.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-27  |  2.9 KB  |  102 lines

  1. /**************************************************************************
  2.    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3.    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4.    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5.    PARTICULAR PURPOSE.
  6.  
  7.    Copyright 1997 Microsoft Corporation.  All Rights Reserved.
  8. **************************************************************************/
  9.  
  10. /**************************************************************************
  11.  
  12.    File:          DockWndw.h
  13.    
  14.    Description:   CDockingWindow definitions.
  15.  
  16. **************************************************************************/
  17.  
  18. #include <windows.h>
  19. #include <shlobj.h>
  20.  
  21. #if (_WIN32_IE < 0x0400)
  22. #define CDockingWindow  IUnknown
  23.  
  24. #else //(_WIN32_IE >= 0x0400)
  25.  
  26. #include "ShlView.h"
  27.  
  28. #ifndef DOCKINGWINDOW_H
  29. #define DOCKINGWINDOW_H
  30.  
  31. #define SHTB_CLASS_NAME (TEXT("RegViewToolbarClass"))
  32.  
  33. /**************************************************************************
  34.    global variables
  35. **************************************************************************/
  36.  
  37. extern HINSTANCE  g_hInst;
  38. extern UINT       g_DllRefCount;
  39.  
  40. #define TOOLBAR_HEIGHT  50
  41.  
  42. /**************************************************************************
  43.  
  44.    CDockingWindow class definition
  45.  
  46. **************************************************************************/
  47.  
  48. class CDockingWindow : public IDockingWindow, public IInputObject, public IObjectWithSite
  49. {
  50. protected:
  51.    DWORD m_ObjRefCount;
  52.  
  53. public:
  54.    CDockingWindow(CShellView*, HWND);
  55.    ~CDockingWindow();
  56.  
  57.    //IUnknown methods
  58.    STDMETHODIMP QueryInterface(REFIID, LPVOID*);
  59.    STDMETHODIMP_(DWORD) AddRef();
  60.    STDMETHODIMP_(DWORD) Release();
  61.  
  62.    //IOleWindow methods
  63.    STDMETHOD (GetWindow) (HWND*);
  64.    STDMETHOD (ContextSensitiveHelp) (BOOL);
  65.  
  66.    //IDockingWindow methods
  67.    STDMETHOD (ShowDW) (BOOL fShow);
  68.    STDMETHOD (CloseDW) (DWORD dwReserved);
  69.    STDMETHOD (ResizeBorderDW) (LPCRECT prcBorder, IUnknown* punkToolbarSite, BOOL fReserved);
  70.  
  71.    //IInputObject methods
  72.    STDMETHOD (UIActivateIO) (BOOL, LPMSG);
  73.    STDMETHOD (HasFocusIO) (void);
  74.    STDMETHOD (TranslateAcceleratorIO) (LPMSG);
  75.  
  76.    //IObjectWithSite methods
  77.    STDMETHOD (SetSite) (IUnknown*);
  78.    STDMETHOD (GetSite) (REFIID, LPVOID*);
  79.  
  80. private:
  81.     BOOL NegotiateBorderSpace(IDockingWindowSite*, LPCRECT prcBorder = NULL);
  82.     RECT m_rcDisplay;
  83.     BOOL m_bFocus;
  84.     HWND m_hwndParent;
  85.     HWND m_hWnd;
  86.     HWND m_hwndCommand;
  87.    CShellView *m_pView;
  88.    IDockingWindowSite *m_pSite;
  89.  
  90. private:
  91.     void FocusChange(BOOL);
  92.    LRESULT OnKillFocus(void);
  93.     LRESULT OnSetFocus(void);
  94.     static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam);
  95.     LRESULT OnPaint(void);
  96.     LRESULT OnCommand(WPARAM wParam, LPARAM lParam);
  97. };
  98.  
  99. #endif   //DOCKINGWINDOW_H
  100.  
  101. #endif   //(_WIN32_IE >= 0x0400)
  102.