ReactOS  0.4.14-dev-815-ge410a12
CBandSiteBase Class Reference

#include <CBandSite.h>

Inheritance diagram for CBandSiteBase:
Collaboration diagram for CBandSiteBase:

Classes

struct  BandObject
 

Public Member Functions

 CBandSiteBase ()
 
 ~CBandSiteBase ()
 
virtual HRESULT STDMETHODCALLTYPE AddBand (IUnknown *punk)
 
virtual HRESULT STDMETHODCALLTYPE EnumBands (UINT uBand, DWORD *pdwBandID)
 
virtual HRESULT STDMETHODCALLTYPE QueryBand (DWORD dwBandID, IDeskBand **ppstb, DWORD *pdwState, LPWSTR pszName, int cchName)
 
virtual HRESULT STDMETHODCALLTYPE SetBandState (DWORD dwBandID, DWORD dwMask, DWORD dwState)
 
virtual HRESULT STDMETHODCALLTYPE RemoveBand (DWORD dwBandID)
 
virtual HRESULT STDMETHODCALLTYPE GetBandObject (DWORD dwBandID, REFIID riid, void **ppv)
 
virtual HRESULT STDMETHODCALLTYPE SetBandSiteInfo (const BANDSITEINFO *pbsinfo)
 
virtual HRESULT STDMETHODCALLTYPE GetBandSiteInfo (BANDSITEINFO *pbsinfo)
 
virtual HRESULT STDMETHODCALLTYPE OnWinEvent (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
 
virtual HRESULT STDMETHODCALLTYPE IsWindowOwner (HWND hWnd)
 
virtual HRESULT STDMETHODCALLTYPE GetWindow (HWND *lphwnd)
 
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp (BOOL fEnterMode)
 
virtual HRESULT STDMETHODCALLTYPE SetDeskBarSite (IUnknown *punkSite)
 
virtual HRESULT STDMETHODCALLTYPE SetModeDBC (DWORD dwMode)
 
virtual HRESULT STDMETHODCALLTYPE UIActivateDBC (DWORD dwState)
 
virtual HRESULT STDMETHODCALLTYPE GetSize (DWORD dwWhich, LPRECT prc)
 
virtual HRESULT STDMETHODCALLTYPE QueryStatus (const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
 
virtual HRESULT STDMETHODCALLTYPE Exec (const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
virtual HRESULT STDMETHODCALLTYPE UIActivateIO (BOOL fActivate, LPMSG lpMsg)
 
virtual HRESULT STDMETHODCALLTYPE HasFocusIO ()
 
virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO (LPMSG lpMsg)
 
virtual HRESULT STDMETHODCALLTYPE OnFocusChangeIS (struct IUnknown *paramC, int param10)
 
virtual HRESULT STDMETHODCALLTYPE QueryService (REFGUID guidService, REFIID riid, void **ppvObject)
 
virtual HRESULT STDMETHODCALLTYPE GetClassID (CLSID *pClassID)
 
virtual HRESULT STDMETHODCALLTYPE IsDirty ()
 
virtual HRESULT STDMETHODCALLTYPE Load (IStream *pStm)
 
virtual HRESULT STDMETHODCALLTYPE Save (IStream *pStm, BOOL fClearDirty)
 
virtual HRESULT STDMETHODCALLTYPE GetSizeMax (ULARGE_INTEGER *pcbSize)
 
virtual HRESULT STDMETHODCALLTYPE DragEnter (IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
 
virtual HRESULT STDMETHODCALLTYPE DragOver (DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
 
virtual HRESULT STDMETHODCALLTYPE DragLeave ()
 
virtual HRESULT STDMETHODCALLTYPE Drop (IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
 
virtual HRESULT STDMETHODCALLTYPE LoadFromStreamBS (IStream *, const GUID &, void **)
 
virtual HRESULT STDMETHODCALLTYPE SaveToStreamBS (IUnknown *, IStream *)
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
- Public Member Functions inherited from IServiceProvider
HRESULT RemoteQueryService ([in] REFGUID guidService, [in] REFIID riid, [out, iid_is(riid)] IUnknown **ppvObject)
 

Private Member Functions

UINT _GetBandID (struct BandObject *Band)
 
struct BandObject_GetBandByID (DWORD dwBandID)
 
void _FreeBand (struct BandObject *Band)
 
DWORD _GetViewMode ()
 
VOID _BuildBandInfo (struct BandObject *Band, REBARBANDINFOW *prbi)
 
HRESULT _UpdateBand (struct BandObject *Band)
 
HRESULT _UpdateAllBands ()
 
HRESULT _UpdateBand (DWORD dwBandID)
 
struct BandObject_GetBandFromHwnd (HWND hwnd)
 
HRESULT _IsBandDeletable (DWORD dwBandID)
 
HRESULT _OnContextMenu (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plrResult)
 

Private Attributes

LONG m_cBands
 
LONG m_cBandsAllocated
 
struct BandObjectm_bands
 
HWND m_hwndRebar
 
CComPtr< IOleWindowm_site
 
DWORD m_dwState
 
DWORD m_dwStyle
 

Additional Inherited Members

- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IPersistStream
typedef IPersistStreamLPPERSISTSTREAM
 
- Public Types inherited from IPersist
typedef IPersistLPPERSIST
 
- Public Types inherited from IDropTarget
typedef IDropTargetLPDROPTARGET
 
- Public Types inherited from IServiceProvider
typedef IServiceProviderLPSERVICEPROVIDER
 
- Public Types inherited from IOleCommandTarget
enum  OLECMDF {
  OLECMDF_SUPPORTED = 0x1, OLECMDF_ENABLED = 0x2, OLECMDF_LATCHED = 0x4, OLECMDF_NINCHED = 0x8,
  OLECMDF_INVISIBLE = 0x10, OLECMDF_DEFHIDEONCTXTMENU = 0x20
}
 
enum  OLECMDTEXTF { OLECMDTEXTF_NONE = 0, OLECMDTEXTF_NAME = 1, OLECMDTEXTF_STATUS = 2 }
 
enum  OLECMDEXECOPT { OLECMDEXECOPT_DODEFAULT = 0, OLECMDEXECOPT_PROMPTUSER = 1, OLECMDEXECOPT_DONTPROMPTUSER = 2, OLECMDEXECOPT_SHOWHELP = 3 }
 
enum  OLECMDID {
  OLECMDID_OPEN = 1, OLECMDID_NEW = 2, OLECMDID_SAVE = 3, OLECMDID_SAVEAS = 4,
  OLECMDID_SAVECOPYAS = 5, OLECMDID_PRINT = 6, OLECMDID_PRINTPREVIEW = 7, OLECMDID_PAGESETUP = 8,
  OLECMDID_SPELL = 9, OLECMDID_PROPERTIES = 10, OLECMDID_CUT = 11, OLECMDID_COPY = 12,
  OLECMDID_PASTE = 13, OLECMDID_PASTESPECIAL = 14, OLECMDID_UNDO = 15, OLECMDID_REDO = 16,
  OLECMDID_SELECTALL = 17, OLECMDID_CLEARSELECTION = 18, OLECMDID_ZOOM = 19, OLECMDID_GETZOOMRANGE = 20,
  OLECMDID_UPDATECOMMANDS = 21, OLECMDID_REFRESH = 22, OLECMDID_STOP = 23, OLECMDID_HIDETOOLBARS = 24,
  OLECMDID_SETPROGRESSMAX = 25, OLECMDID_SETPROGRESSPOS = 26, OLECMDID_SETPROGRESSTEXT = 27, OLECMDID_SETTITLE = 28,
  OLECMDID_SETDOWNLOADSTATE = 29, OLECMDID_STOPDOWNLOAD = 30, OLECMDID_ONTOOLBARACTIVATED = 31, OLECMDID_FIND = 32,
  OLECMDID_DELETE = 33, OLECMDID_HTTPEQUIV = 34, OLECMDID_HTTPEQUIV_DONE = 35, OLECMDID_ENABLE_INTERACTION = 36,
  OLECMDID_ONUNLOAD = 37, OLECMDID_PROPERTYBAG2 = 38, OLECMDID_PREREFRESH = 39, OLECMDID_SHOWSCRIPTERROR = 40,
  OLECMDID_SHOWMESSAGE = 41, OLECMDID_SHOWFIND = 42, OLECMDID_SHOWPAGESETUP = 43, OLECMDID_SHOWPRINT = 44,
  OLECMDID_CLOSE = 45, OLECMDID_ALLOWUILESSSAVEAS = 46, OLECMDID_DONTDOWNLOADCSS = 47, OLECMDID_UPDATEPAGESTATUS = 48,
  OLECMDID_PRINT2 = 49, OLECMDID_PRINTPREVIEW2 = 50, OLECMDID_SETPRINTTEMPLATE = 51, OLECMDID_GETPRINTTEMPLATE = 52,
  OLECMDID_PAGEACTIONBLOCKED = 55, OLECMDID_PAGEACTIONUIQUERY = 56, OLECMDID_FOCUSVIEWCONTROLS = 57, OLECMDID_FOCUSVIEWCONTROLSQUERY = 58,
  OLECMDID_SHOWPAGEACTIONMENU = 59, OLECMDID_ADDTRAVELENTRY = 60, OLECMDID_UPDATETRAVELENTRY = 61, OLECMDID_UPDATEBACKFORWARDSTATE = 62,
  OLECMDID_OPTICAL_ZOOM = 63, OLECMDID_OPTICAL_GETZOOMRANGE = 64, OLECMDID_WINDOWSTATECHANGED = 65, OLECMDID_ACTIVEXINSTALLSCOPE = 66,
  OLECMDID_UPDATETRAVELENTRY_DATARECOVERY = 67, OLECMDID_SHOWTASKDLG = 68, OLECMDID_POPSTATEEVENT = 69, OLECMDID_VIEWPORT_MODE = 70,
  OLECMDID_LAYOUT_VIEWPORT_WIDTH = 71, OLECMDID_VISUAL_VIEWPORT_EXCLUDE_BOTTOM = 72, OLECMDID_USER_OPTICAL_ZOOM = 73, OLECMDID_PAGEAVAILABLE = 74,
  OLECMDID_GETUSERSCALABLE = 75, OLECMDID_UPDATE_CARET = 76, OLECMDID_ENABLE_VISIBILITY = 77, OLECMDID_MEDIA_PLAYBACK = 78
}
 
typedef IOleCommandTargetLPOLECOMMANDTARGET
 
typedef enum IOleCommandTarget::OLECMDF OLECMDF
 
typedef struct IOleCommandTarget::_tagOLECMD OLECMD
 
typedef struct IOleCommandTarget::_tagOLECMDTEXT OLECMDTEXT
 
typedef enum IOleCommandTarget::OLECMDTEXTF OLECMDTEXTF
 
typedef enum IOleCommandTarget::OLECMDEXECOPT OLECMDEXECOPT
 
typedef enum IOleCommandTarget::OLECMDID OLECMDID
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Public Attributes inherited from IDropTarget
const DWORD MK_ALT = 0x20
 
const DWORD DROPEFFECT_NONE = 0
 
const DWORD DROPEFFECT_COPY = 1
 
const DWORD DROPEFFECT_MOVE = 2
 
const DWORD DROPEFFECT_LINK = 4
 
const DWORD DROPEFFECT_SCROLL = 0x80000000
 
const DWORD DD_DEFSCROLLINSET = 11
 
const DWORD DD_DEFSCROLLDELAY = 50
 
const DWORD DD_DEFSCROLLINTERVAL = 50
 
const DWORD DD_DEFDRAGDELAY = 200
 
const DWORD DD_DEFDRAGMINDIST = 2
 

Detailed Description

Definition at line 29 of file CBandSite.h.

Constructor & Destructor Documentation

◆ CBandSiteBase()

CBandSiteBase::CBandSiteBase ( )

Definition at line 39 of file CBandSite.cpp.

39  :
40  m_cBands(0),
42  m_bands(NULL),
44  m_dwState(0),
45  m_dwStyle(0)
46 {
47 }
LONG m_cBands
Definition: CBandSite.h:52
DWORD m_dwState
Definition: CBandSite.h:57
struct BandObject * m_bands
Definition: CBandSite.h:54
HWND m_hwndRebar
Definition: CBandSite.h:55
smooth NULL
Definition: ftsmooth.c:416
DWORD m_dwStyle
Definition: CBandSite.h:58
LONG m_cBandsAllocated
Definition: CBandSite.h:53

◆ ~CBandSiteBase()

CBandSiteBase::~CBandSiteBase ( )

Definition at line 379 of file CBandSite.cpp.

380 {
381 
382  TRACE("destroying %p\n", this);
383 
384  if (m_hwndRebar != NULL)
385  {
387  m_hwndRebar = NULL;
388  }
389 
390  if (m_bands != NULL)
391  {
392  for (INT i = 0; i < m_cBandsAllocated; i++)
393  {
394  if (m_bands[i].DeskBand != NULL)
395  _FreeBand(&m_bands[i]);
396  }
398  m_bands = NULL;
399  }
400 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
struct BandObject * m_bands
Definition: CBandSite.h:54
BOOL WINAPI DestroyWindow(_In_ HWND)
int32_t INT
Definition: typedefs.h:56
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
void _FreeBand(struct BandObject *Band)
Definition: CBandSite.cpp:65
HWND m_hwndRebar
Definition: CBandSite.h:55
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG m_cBandsAllocated
Definition: CBandSite.h:53

Member Function Documentation

◆ _BuildBandInfo()

VOID CBandSiteBase::_BuildBandInfo ( struct BandObject Band,
REBARBANDINFOW prbi 
)
private

Definition at line 90 of file CBandSite.cpp.

91 {
92  ZeroMemory(prbi, sizeof(*prbi));
93  prbi->cbSize = sizeof(*prbi);
94 
95  prbi->fMask = RBBIM_ID;
96  prbi->wID = _GetBandID(Band);
97 
98  if (Band->dbi.dwMask & DBIM_MINSIZE)
99  {
100  prbi->fMask |= RBBIM_CHILDSIZE;
101  prbi->cxMinChild = Band->dbi.ptMinSize.x;
102  prbi->cyMinChild = Band->dbi.ptMinSize.y;
103  }
104 
105  if (Band->dbi.dwMask & DBIM_MAXSIZE)
106  {
107  prbi->fMask |= RBBIM_CHILDSIZE;
108  prbi->cyMaxChild = Band->dbi.ptMaxSize.y;
109  }
110 
111  if ((Band->dbi.dwMask & (DBIM_INTEGRAL | DBIM_MODEFLAGS)) == (DBIM_INTEGRAL | DBIM_MODEFLAGS) &&
112  (Band->dbi.dwModeFlags & DBIMF_VARIABLEHEIGHT))
113  {
114  prbi->fMask |= RBBIM_CHILDSIZE;
115  prbi->cyIntegral = Band->dbi.ptIntegral.y;
116  }
117 
118  if (Band->dbi.dwMask & DBIM_ACTUAL)
119  {
121  prbi->cxIdeal = Band->dbi.ptActual.x;
122  prbi->cx = Band->dbi.ptActual.x;
123  prbi->cyChild = Band->dbi.ptActual.y;
124  }
125 
126  if (Band->dbi.dwMask & DBIM_TITLE)
127  {
128  prbi->fMask |= RBBIM_TEXT;
129  prbi->lpText = Band->dbi.wszTitle;
130  prbi->cch = wcslen(Band->dbi.wszTitle);
131  }
132 
133  if (Band->dbi.dwMask & DBIM_MODEFLAGS)
134  {
135  prbi->fMask |= RBBIM_STYLE;
136 
137  if (Band->dbi.dwModeFlags & DBIMF_FIXED)
139  if (Band->dbi.dwModeFlags & DBIMF_FIXEDBMP)
140  prbi->fStyle |= RBBS_FIXEDBMP;
141  if (Band->dbi.dwModeFlags & DBIMF_VARIABLEHEIGHT)
142  prbi->fStyle |= RBBS_VARIABLEHEIGHT;
143  if (Band->dbi.dwModeFlags & DBIMF_DEBOSSED)
144  prbi->fStyle |= RBBS_CHILDEDGE;
145  if (Band->dbi.dwModeFlags & DBIMF_USECHEVRON)
146  prbi->fStyle |= RBBS_USECHEVRON;
147  if (Band->dbi.dwModeFlags & DBIMF_BREAK)
148  prbi->fStyle |= RBBS_BREAK;
149  if (Band->dbi.dwModeFlags & DBIMF_TOPALIGN)
150  prbi->fStyle |= RBBS_TOPALIGN;
151  if ((Band->dbi.dwModeFlags & DBIMF_NOGRIPPER) || (m_dwStyle & BSIS_NOGRIPPER))
152  prbi->fStyle |= RBBS_NOGRIPPER;
153  if ((Band->dbi.dwModeFlags & DBIMF_ALWAYSGRIPPER) || (m_dwStyle & BSIS_ALWAYSGRIPPER))
154  prbi->fStyle |= RBBS_GRIPPERALWAYS;
155  }
156 
157  if (Band->bHiddenTitle || (m_dwStyle & BSIS_NOCAPTION))
158  {
159  prbi->fMask |= RBBIM_STYLE;
160  prbi->fStyle |= RBBS_HIDETITLE;
161  }
162 
163  if ((Band->dbi.dwMask & (DBIM_BKCOLOR | DBIM_MODEFLAGS)) == (DBIM_BKCOLOR | DBIM_MODEFLAGS) &&
164  (Band->dbi.dwModeFlags & DBIMF_BKCOLOR))
165  {
166  prbi->fMask |= RBBIM_COLORS;
167  prbi->clrFore = (COLORREF)(COLOR_WINDOWTEXT + 1);
168  prbi->clrBack = Band->dbi.crBkgnd;
169  }
170 }
#define RBBS_BREAK
Definition: commctrl.h:1485
#define RBBIM_ID
Definition: commctrl.h:1506
#define ZeroMemory
Definition: winbase.h:1642
#define RBBS_CHILDEDGE
Definition: commctrl.h:1487
#define RBBS_TOPALIGN
Definition: commctrl.h:1496
#define RBBIM_STYLE
Definition: commctrl.h:1498
#define RBBIM_SIZE
Definition: commctrl.h:1504
COLORREF clrBack
Definition: commctrl.h:1545
COLORREF clrFore
Definition: commctrl.h:1544
#define RBBS_HIDETITLE
#define RBBS_VARIABLEHEIGHT
Definition: commctrl.h:1491
#define RBBIM_COLORS
Definition: commctrl.h:1499
#define RBBIM_TEXT
Definition: commctrl.h:1500
DWORD COLORREF
Definition: windef.h:300
#define COLOR_WINDOWTEXT
Definition: winuser.h:911
#define RBBS_FIXEDSIZE
Definition: commctrl.h:1486
#define RBBIM_CHILDSIZE
Definition: commctrl.h:1503
#define RBBS_USECHEVRON
Definition: commctrl.h:1494
DWORD m_dwStyle
Definition: CBandSite.h:58
#define RBBS_FIXEDBMP
Definition: commctrl.h:1490
UINT _GetBandID(struct BandObject *Band)
Definition: CBandSite.cpp:49
#define RBBS_GRIPPERALWAYS
Definition: commctrl.h:1492
#define RBBS_NOGRIPPER
Definition: commctrl.h:1493
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define RBBIM_IDEALSIZE
Definition: commctrl.h:1507

Referenced by _UpdateBand(), and AddBand().

◆ _FreeBand()

void CBandSiteBase::_FreeBand ( struct BandObject Band)
private

Definition at line 65 of file CBandSite.cpp.

66 {
67  ATLASSERT(Band->DeskBand != NULL);
68  ATLASSERT(Band->OleWindow != NULL);
69  ATLASSERT(Band->WndEvtHandler != NULL);
70  Band->DeskBand->Release();
71  Band->OleWindow->Release();
72  Band->WndEvtHandler->Release();
73  memset(Band, 0, sizeof(*Band));
74  m_cBands--;
75 }
LONG m_cBands
Definition: CBandSite.h:52
#define ATLASSERT(x)
Definition: CComVariant.cpp:9
smooth NULL
Definition: ftsmooth.c:416
#define memset(x, y, z)
Definition: compat.h:39

Referenced by AddBand(), RemoveBand(), and ~CBandSiteBase().

◆ _GetBandByID()

struct CBandSiteBase::BandObject * CBandSiteBase::_GetBandByID ( DWORD  dwBandID)
private

Definition at line 54 of file CBandSite.cpp.

55 {
56  if ((LONG)dwBandID >= m_cBandsAllocated)
57  return NULL;
58 
59  if (m_bands[dwBandID].DeskBand == NULL)
60  return NULL;
61 
62  return &m_bands[dwBandID];
63 }
struct BandObject * m_bands
Definition: CBandSite.h:54
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
LONG m_cBandsAllocated
Definition: CBandSite.h:53

Referenced by _OnContextMenu(), _UpdateBand(), GetBandObject(), QueryBand(), RemoveBand(), and SetBandState().

◆ _GetBandFromHwnd()

struct CBandSiteBase::BandObject * CBandSiteBase::_GetBandFromHwnd ( HWND  hwnd)
private

Definition at line 357 of file CBandSite.cpp.

358 {
359  HRESULT hRet;
360  HWND hWndBand;
361  LONG i;
362 
363  for (i = 0; i < m_cBandsAllocated; i++)
364  {
365  if (m_bands[i].DeskBand != NULL)
366  {
367  ASSERT(m_bands[i].OleWindow);
368 
369  hWndBand = NULL;
370  hRet = m_bands[i].OleWindow->GetWindow(&hWndBand);
371  if (SUCCEEDED(hRet) && hWndBand == hwnd)
372  return &m_bands[i];
373  }
374  }
375 
376  return NULL;
377 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct BandObject * m_bands
Definition: CBandSite.h:54
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define ASSERT(cond)
Definition: CBandSite.cpp:25
LONG HRESULT
Definition: typedefs.h:77
LONG m_cBandsAllocated
Definition: CBandSite.h:53
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by IsWindowOwner(), and OnWinEvent().

◆ _GetBandID()

UINT CBandSiteBase::_GetBandID ( struct BandObject Band)
private

Definition at line 49 of file CBandSite.cpp.

50 {
51  return (UINT)(Band - m_bands);
52 }
struct BandObject * m_bands
Definition: CBandSite.h:54
unsigned int UINT
Definition: ndis.h:50

Referenced by _BuildBandInfo(), _UpdateBand(), AddBand(), and RemoveBand().

◆ _GetViewMode()

DWORD CBandSiteBase::_GetViewMode ( )
private

Definition at line 77 of file CBandSite.cpp.

78 {
79  DWORD dwStyle;
80 
81  /* FIXME: What about DBIF_VIEWMODE_FLOATING and DBIF_VIEWMODE_TRANSPARENT? */
83 
84  if (dwStyle & CCS_VERT)
85  return DBIF_VIEWMODE_VERTICAL;
86  else
87  return DBIF_VIEWMODE_NORMAL;
88 }
#define CCS_VERT
Definition: commctrl.h:2245
HWND m_hwndRebar
Definition: CBandSite.h:55
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GWL_STYLE
Definition: winuser.h:846
#define GetWindowLongPtr
Definition: treelist.c:73

Referenced by _UpdateBand().

◆ _IsBandDeletable()

HRESULT CBandSiteBase::_IsBandDeletable ( DWORD  dwBandID)
private

Definition at line 241 of file CBandSite.cpp.

242 {
243  CComPtr<IBandSite> pbs;
244 
245  /* Use QueryInterface so that we get the outer object in case we have one */
247  if (FAILED_UNEXPECTEDLY(hr))
248  return hr;
249 
250  DWORD dwState;
251  hr = pbs->QueryBand(dwBandID, NULL, &dwState, NULL, NULL);
252  if (FAILED_UNEXPECTEDLY(hr))
253  return hr;
254 
255  return ((dwState & BSSF_UNDELETEABLE) != 0) ? S_FALSE : S_OK;
256 }
HRESULT hr
Definition: shlfolder.c:183
#define IID_PPV_ARG(Itype, ppType)
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)

Referenced by _OnContextMenu().

◆ _OnContextMenu()

HRESULT CBandSiteBase::_OnContextMenu ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
LRESULT plrResult 
)
private

Definition at line 258 of file CBandSite.cpp.

259 {
260  /* Find the index fo the band that was clicked */
261  int x = GET_X_LPARAM(lParam);
262  int y = GET_Y_LPARAM(lParam);
263 
264  RBHITTESTINFO htInfo = {{x, y}};
265  ScreenToClient(m_hwndRebar, &htInfo.pt);
266  int iBand = SendMessageW(m_hwndRebar, RB_HITTEST, 0, (LPARAM)&htInfo);
267  if (iBand < 0)
268  {
269  /* FIXME: what to do here? */
270  return S_OK;
271  }
272 
273  /* Now get the id of the band that was clicked */
276 
277  /* Finally get the band */
278  DWORD dwBandID = bandInfo.wID;
279  struct BandObject *Band = _GetBandByID(dwBandID);
280  if (Band == NULL)
281  return E_FAIL;
282 
283  HMENU hMenu = CreatePopupMenu();
284  if (hMenu == NULL)
285  return E_OUTOFMEMORY;
286 
287  /* Try to load the menu of the band */
288  UINT idBandLast = 0;
289  CComPtr<IContextMenu> pcm;
290  HRESULT hr = Band->DeskBand->QueryInterface(IID_PPV_ARG(IContextMenu, &pcm));
291  if (SUCCEEDED(hr))
292  {
293  hr = pcm->QueryContextMenu(hMenu, 0, 0, UINT_MAX, CMF_NORMAL);
294  if (SUCCEEDED(hr))
295  {
296  idBandLast = HRESULT_CODE(hr);
297  }
298  }
299 
300  if (!(m_dwStyle & BSIS_LOCKED))
301  {
302  /* Load the static part of the menu */
303  HMENU hMenuStatic = LoadMenuW(GetModuleHandleW(L"browseui.dll"), MAKEINTRESOURCEW(IDM_BAND_MENU));
304 
305  if (hMenuStatic)
306  {
308 
309  ::DestroyMenu(hMenuStatic);
310 
311  hr = _IsBandDeletable(dwBandID);
312  if (FAILED_UNEXPECTEDLY(hr))
313  return hr;
314 
315  /* Remove the close item if it is not deletable */
316  if (hr == S_FALSE || (Band->dbi.dwModeFlags & DBIMF_UNDELETEABLE) != 0)
318 
319  if ((Band->dbi.dwMask & DBIM_TITLE) == 0)
321  else
322  CheckMenuItem(hMenu, IDM_BAND_TITLE, Band->bHiddenTitle ? MF_UNCHECKED : MF_CHECKED);
323  }
324  }
325 
326  /* TODO: Query the menu of our site */
327 
328  UINT uCommand = ::TrackPopupMenuEx(hMenu, TPM_RETURNCMD, x, y, m_hwndRebar, NULL);
329  if (uCommand < idBandLast)
330  {
331  CMINVOKECOMMANDINFO cmi = { sizeof(cmi), 0, m_hwndRebar, MAKEINTRESOURCEA(uCommand)};
332  hr = pcm->InvokeCommand(&cmi);
333  if (FAILED_UNEXPECTEDLY(hr))
334  return hr;
335  }
336  else
337  {
338  if (uCommand == IDM_BAND_TITLE)
339  {
340  Band->bHiddenTitle = !Band->bHiddenTitle;
341 
342  hr = _UpdateBand(dwBandID);
343  if (FAILED_UNEXPECTEDLY(hr))
344  return hr;
345  }
346  else if(uCommand == IDM_BAND_CLOSE)
347  {
348  hr = RemoveBand(dwBandID);
349  if (FAILED_UNEXPECTEDLY(hr))
350  return hr;
351  }
352  }
353 
354  return S_OK;
355 }
#define MF_BYCOMMAND
Definition: winuser.h:202
#define IDM_BAND_MENU
Definition: resource.h:63
UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
Definition: shlmenu.c:857
HRESULT hr
Definition: shlfolder.c:183
#define TPM_RETURNCMD
Definition: winuser.h:2362
HRESULT _IsBandDeletable(DWORD dwBandID)
Definition: CBandSite.cpp:241
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
#define GET_X_LPARAM(lp)
Definition: windowsx.h:274
#define RBBIM_ID
Definition: commctrl.h:1506
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define RB_GETBANDINFOW
Definition: commctrl.h:1605
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const struct bandInfoStruct bandInfo[9]
Definition: layer3.c:95
HWND m_hwndRebar
Definition: CBandSite.h:55
#define IDM_BAND_TITLE
Definition: resource.h:64
virtual HRESULT STDMETHODCALLTYPE RemoveBand(DWORD dwBandID)
Definition: CBandSite.cpp:633
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define MF_CHECKED
Definition: winuser.h:132
LONG HRESULT
Definition: typedefs.h:77
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
static const WCHAR L[]
Definition: oid.c:1250
#define RB_HITTEST
Definition: commctrl.h:1577
DWORD m_dwStyle
Definition: CBandSite.h:58
#define MF_UNCHECKED
Definition: winuser.h:204
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define UINT_MAX
Definition: limits.h:41
#define S_OK
Definition: intsafe.h:59
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned int UINT
Definition: ndis.h:50
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:275
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:846
#define HRESULT_CODE(hr)
Definition: winerror.h:76
#define MM_SUBMENUSHAVEIDS
Definition: shlobj.h:2320
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
struct BandObject * _GetBandByID(DWORD dwBandID)
Definition: CBandSite.cpp:54
HRESULT _UpdateBand(struct BandObject *Band)
Definition: CBandSite.cpp:172
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDM_BAND_CLOSE
Definition: resource.h:65
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LPARAM lParam
Definition: combotst.c:139
#define MM_DONTREMOVESEPS
Definition: shlobj.h:2321
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by OnWinEvent().

◆ _UpdateAllBands()

HRESULT CBandSiteBase::_UpdateAllBands ( )
private

Definition at line 212 of file CBandSite.cpp.

213 {
214  LONG i;
215  HRESULT hRet;
216 
217  for (i = 0; i < m_cBandsAllocated; i++)
218  {
219  if (m_bands[i].DeskBand != NULL)
220  {
221  hRet = _UpdateBand(&m_bands[i]);
222  if (FAILED_UNEXPECTEDLY(hRet))
223  return hRet;
224  }
225  }
226 
227  return S_OK;
228 }
struct BandObject * m_bands
Definition: CBandSite.h:54
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
LONG m_cBandsAllocated
Definition: CBandSite.h:53
#define S_OK
Definition: intsafe.h:59
HRESULT _UpdateBand(struct BandObject *Band)
Definition: CBandSite.cpp:172

Referenced by AddBand(), Exec(), and SetBandSiteInfo().

◆ _UpdateBand() [1/2]

HRESULT CBandSiteBase::_UpdateBand ( struct BandObject Band)
private

Definition at line 172 of file CBandSite.cpp.

173 {
174  REBARBANDINFOW rbi;
175  DWORD dwViewMode;
176  UINT uBand;
177  HRESULT hRet;
178 
179  ZeroMemory(&Band->dbi, sizeof(Band->dbi));
180  Band->dbi.dwMask = DBIM_MINSIZE | DBIM_MAXSIZE | DBIM_INTEGRAL |
181  DBIM_ACTUAL | DBIM_TITLE | DBIM_MODEFLAGS | DBIM_BKCOLOR;
182 
183  dwViewMode = _GetViewMode();
184 
185  hRet = Band->DeskBand->GetBandInfo((DWORD)_GetBandID(Band), dwViewMode, &Band->dbi);
186  if (SUCCEEDED(hRet))
187  {
188  _BuildBandInfo(Band, &rbi);
189  if (SUCCEEDED(Band->OleWindow->GetWindow(&rbi.hwndChild)) &&
190  rbi.hwndChild != NULL)
191  {
192  rbi.fMask |= RBBIM_CHILD;
193  WARN ("ReBar band uses child window 0x%p\n", rbi.hwndChild);
194  }
195 
196  uBand = (UINT)SendMessageW(m_hwndRebar, RB_IDTOINDEX, (WPARAM)rbi.wID, 0);
197  if (uBand != (UINT)-1)
198  {
199  if (!SendMessageW(m_hwndRebar, RB_SETBANDINFOW, (WPARAM)uBand, reinterpret_cast<LPARAM>(&rbi)))
200  {
201  WARN("Failed to update the rebar band!\n");
202  }
203  }
204  else
205  WARN("Failed to map rebar band id to index!\n");
206 
207  }
208 
209  return hRet;
210 }
#define RBBIM_CHILD
Definition: commctrl.h:1502
#define WARN(fmt,...)
Definition: debug.h:111
VOID _BuildBandInfo(struct BandObject *Band, REBARBANDINFOW *prbi)
Definition: CBandSite.cpp:90
#define ZeroMemory
Definition: winbase.h:1642
DWORD _GetViewMode()
Definition: CBandSite.cpp:77
UINT_PTR WPARAM
Definition: windef.h:207
HWND m_hwndRebar
Definition: CBandSite.h:55
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
#define RB_SETBANDINFOW
Definition: commctrl.h:1580
UINT _GetBandID(struct BandObject *Band)
Definition: CBandSite.cpp:49
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define RB_IDTOINDEX
Definition: commctrl.h:1584
unsigned int UINT
Definition: ndis.h:50
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by _OnContextMenu(), _UpdateAllBands(), _UpdateBand(), AddBand(), and Exec().

◆ _UpdateBand() [2/2]

HRESULT CBandSiteBase::_UpdateBand ( DWORD  dwBandID)
private

Definition at line 230 of file CBandSite.cpp.

231 {
232  struct BandObject *Band;
233 
234  Band = _GetBandByID(dwBandID);
235  if (Band == NULL)
236  return E_FAIL;
237 
238  return _UpdateBand(Band);
239 }
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
struct BandObject * _GetBandByID(DWORD dwBandID)
Definition: CBandSite.cpp:54
HRESULT _UpdateBand(struct BandObject *Band)
Definition: CBandSite.cpp:172

◆ AddBand()

HRESULT STDMETHODCALLTYPE CBandSiteBase::AddBand ( IUnknown punk)
virtual

Implements IBandSite.

Definition at line 402 of file CBandSite.cpp.

403 {
404  LONG NewAllocated;
405  struct BandObject *NewBand = NULL;
406  CComPtr<IDeskBand> DeskBand;
407  CComPtr<IObjectWithSite> ObjWithSite;
408  CComPtr<IOleWindow> OleWindow;
409  CComPtr<IWinEventHandler> WndEvtHandler;
410  REBARBANDINFOW rbi;
411  HRESULT hRet;
412  UINT uBand;
413 
414  TRACE("(%p, %p)\n", this, punk);
415 
416  if (punk == NULL || m_hwndRebar == NULL)
417  return E_FAIL;
418 
419  hRet = punk->QueryInterface(IID_PPV_ARG(IDeskBand, &DeskBand));
420  if (FAILED_UNEXPECTEDLY(hRet))
421  return hRet;
422 
423  hRet = punk->QueryInterface(IID_PPV_ARG(IObjectWithSite, &ObjWithSite));
424  if (FAILED_UNEXPECTEDLY(hRet))
425  return hRet;
426 
427  hRet = punk->QueryInterface(IID_PPV_ARG(IOleWindow, &OleWindow));
428  if (FAILED_UNEXPECTEDLY(hRet))
429  return hRet;
430 
431  hRet = punk->QueryInterface(IID_PPV_ARG(IWinEventHandler, &WndEvtHandler));
432  if (FAILED_UNEXPECTEDLY(hRet))
433  return hRet;
434 
436  {
437  /* Search for a free band object */
438  for (INT i = 0; i < m_cBandsAllocated; i++)
439  {
440  if (m_bands[i].DeskBand == NULL)
441  {
442  NewBand = &m_bands[i];
443  break;
444  }
445  }
446  }
447  else if (m_cBandsAllocated > 0)
448  {
449  ASSERT (m_bands != NULL);
450 
451  /* Reallocate the band object array */
452  NewAllocated = m_cBandsAllocated + 8;
453  if (NewAllocated > 0xFFFF)
454  NewAllocated = 0xFFFF;
455  if (NewAllocated == m_cBandsAllocated)
456  {
457  return E_OUTOFMEMORY;
458  }
459 
460 
461  NewBand = static_cast<struct BandObject *>(CoTaskMemAlloc(NewAllocated * sizeof(struct BandObject)));
462  if (NewBand == NULL)
463  {
464  return E_OUTOFMEMORY;
465  }
466 
467  /* Copy the old array */
468  memcpy(NewBand, m_bands, m_cBandsAllocated * sizeof(struct BandObject));
469 
470  /* Initialize the added bands */
471  memset(&NewBand[m_cBandsAllocated], 0, (NewAllocated - m_cBandsAllocated) * sizeof(struct BandObject));
472 
473  m_cBandsAllocated = NewAllocated;
475  m_bands = NewBand;
476  }
477  else
478  {
479  ASSERT(m_bands == NULL);
481  ASSERT(m_cBands == 0);
482 
483  /* Allocate new array */
484  m_bands = static_cast<struct BandObject *>(CoTaskMemAlloc(8 * sizeof(struct BandObject)));
485  if (m_bands == NULL)
486  {
487  return E_OUTOFMEMORY;
488  }
489 
490  /* Initialize the added bands */
491  memset(m_bands, 0, 8 * sizeof(struct BandObject));
492 
493  m_cBandsAllocated += 8;
494  NewBand = &m_bands[0];
495  }
496 
497  ASSERT(NewBand != NULL);
498 
499  m_cBands++;
500  NewBand->DeskBand = DeskBand.Detach();
501  NewBand->OleWindow = OleWindow.Detach();
502  NewBand->WndEvtHandler = WndEvtHandler.Detach();
503 
504  /* Create the ReBar band */
505  hRet = ObjWithSite->SetSite(static_cast<IOleWindow *>(this));
506  if (SUCCEEDED(hRet))
507  {
508  uBand = 0xffffffff;
509  if (SUCCEEDED(_UpdateBand(NewBand)))
510  {
511  if (NewBand->dbi.dwMask & DBIM_MODEFLAGS)
512  {
513  if (NewBand->dbi.dwModeFlags & DBIMF_ADDTOFRONT)
514  uBand = 0;
515  }
516  }
517 
518  _BuildBandInfo(NewBand, &rbi);
519 
520  if (SUCCEEDED(NewBand->OleWindow->GetWindow(&rbi.hwndChild)) &&
521  rbi.hwndChild != NULL)
522  {
523  rbi.fMask |= RBBIM_CHILD;
524  WARN ("ReBar band uses child window 0x%p\n", rbi.hwndChild);
525  }
526 
527  if (!SendMessageW(m_hwndRebar, RB_INSERTBANDW, (WPARAM)uBand, reinterpret_cast<LPARAM>(&rbi)))
528  return E_FAIL;
529 
530  hRet = (HRESULT)((USHORT)_GetBandID(NewBand));
531 
532  _UpdateAllBands();
533  }
534  else
535  {
536  WARN("IBandSite::AddBand(): Call to IDeskBand::SetSite() failed: %x\n", hRet);
537 
538  /* Remove the band from the ReBar control */
539  _BuildBandInfo(NewBand, &rbi);
540  uBand = (UINT)SendMessageW(m_hwndRebar, RB_IDTOINDEX, (WPARAM)rbi.wID, 0);
541  if (uBand != (UINT)-1)
542  {
543  if (!SendMessageW(m_hwndRebar, RB_DELETEBAND, (WPARAM)uBand, 0))
544  {
545  ERR("Failed to delete band!\n");
546  }
547  }
548  else
549  ERR("Failed to map band id to index!\n");
550 
551  _FreeBand(NewBand);
552 
553  hRet = E_FAIL;
554  }
555 
556  return hRet;
557 }
#define HRESULT
Definition: msvc.h:7
#define RBBIM_CHILD
Definition: commctrl.h:1502
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
LONG m_cBands
Definition: CBandSite.h:52
struct BandObject * m_bands
Definition: CBandSite.h:54
#define WARN(fmt,...)
Definition: debug.h:111
VOID _BuildBandInfo(struct BandObject *Band, REBARBANDINFOW *prbi)
Definition: CBandSite.cpp:90
UINT_PTR WPARAM
Definition: windef.h:207
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
int32_t INT
Definition: typedefs.h:56
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
long LONG
Definition: pedump.c:60
void _FreeBand(struct BandObject *Band)
Definition: CBandSite.cpp:65
HWND m_hwndRebar
Definition: CBandSite.h:55
smooth NULL
Definition: ftsmooth.c:416
#define RB_INSERTBANDW
Definition: commctrl.h:1579
#define ASSERT(cond)
Definition: CBandSite.cpp:25
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERR(fmt,...)
Definition: debug.h:109
LONG m_cBandsAllocated
Definition: CBandSite.h:53
UINT _GetBandID(struct BandObject *Band)
Definition: CBandSite.cpp:49
HRESULT _UpdateAllBands()
Definition: CBandSite.cpp:212
unsigned short USHORT
Definition: pedump.c:61
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define RB_IDTOINDEX
Definition: commctrl.h:1584
unsigned int UINT
Definition: ndis.h:50
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define RB_DELETEBAND
Definition: commctrl.h:1572
HRESULT _UpdateBand(struct BandObject *Band)
Definition: CBandSite.cpp:172
#define memset(x, y, z)
Definition: compat.h:39
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ ContextSensitiveHelp()

HRESULT STDMETHODCALLTYPE CBandSiteBase::ContextSensitiveHelp ( BOOL  fEnterMode)
virtual

Definition at line 788 of file CBandSite.cpp.

789 {
790  FIXME("(%p, %d)\n", this, fEnterMode);
791  return E_NOTIMPL;
792 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DragEnter()

HRESULT STDMETHODCALLTYPE CBandSiteBase::DragEnter ( IDataObject pDataObj,
DWORD  grfKeyState,
POINTL  pt,
DWORD pdwEffect 
)
virtual

Implements IDropTarget.

Definition at line 977 of file CBandSite.cpp.

979 {
980  return E_NOTIMPL;
981 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DragLeave()

HRESULT STDMETHODCALLTYPE CBandSiteBase::DragLeave ( void  )
virtual

Implements IDropTarget.

Definition at line 988 of file CBandSite.cpp.

989 {
990  return E_NOTIMPL;
991 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DragOver()

HRESULT STDMETHODCALLTYPE CBandSiteBase::DragOver ( DWORD  grfKeyState,
POINTL  pt,
DWORD pdwEffect 
)
virtual

Implements IDropTarget.

Definition at line 983 of file CBandSite.cpp.

984 {
985  return E_NOTIMPL;
986 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Drop()

HRESULT STDMETHODCALLTYPE CBandSiteBase::Drop ( IDataObject pDataObj,
DWORD  grfKeyState,
POINTL  pt,
DWORD pdwEffect 
)
virtual

Implements IDropTarget.

Definition at line 993 of file CBandSite.cpp.

994 {
995  return E_NOTIMPL;
996 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ EnumBands()

HRESULT STDMETHODCALLTYPE CBandSiteBase::EnumBands ( UINT  uBand,
DWORD pdwBandID 
)
virtual

Implements IBandSite.

Definition at line 559 of file CBandSite.cpp.

560 {
561  DWORD i;
562 
563  TRACE("(%p, %u, %p)\n", this, uBand, pdwBandID);
564 
565  if (uBand == 0xffffffff)
566  return (UINT)m_cBands;
567 
568  if (uBand >= (UINT)m_cBands)
569  return E_FAIL;
570 
571  for (i = 0; i < (DWORD)m_cBandsAllocated; i++)
572  {
573  if (m_bands[i].DeskBand != NULL)
574  {
575  if (uBand == 0)
576  {
577  *pdwBandID = i;
578  return S_OK;
579  }
580 
581  uBand--;
582  }
583  }
584 
585  return E_FAIL;
586 }
LONG m_cBands
Definition: CBandSite.h:52
struct BandObject * m_bands
Definition: CBandSite.h:54
#define E_FAIL
Definition: ddrawi.h:102
#define DWORD
Definition: nt_native.h:44
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG m_cBandsAllocated
Definition: CBandSite.h:53
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50

◆ Exec()

HRESULT STDMETHODCALLTYPE CBandSiteBase::Exec ( const GUID pguidCmdGroup,
DWORD  nCmdID,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
virtual

Implements IOleCommandTarget.

Definition at line 884 of file CBandSite.cpp.

886 {
887  HRESULT hRet = S_OK;
888 
889  TRACE("(%p, %p, %u, %u, %p, %p)\n", this, pguidCmdGroup, nCmdID, nCmdExecOpt, pvaIn, pvaOut);
890 
891  if (m_hwndRebar == NULL)
892  return E_FAIL;
893 
894  if (IsEqualIID(*pguidCmdGroup, IID_IDeskBand))
895  {
896  switch (nCmdID)
897  {
899  if (pvaIn == NULL)
900  hRet = _UpdateAllBands();
901  else
902  {
903  /* Update a single band */
904  if (pvaIn->n1.n2.vt == VT_I4)
905  hRet = _UpdateBand(pvaIn->n1.n2.n3.lVal);
906  else
907  hRet = E_FAIL;
908  }
909  break;
910 
911  case DBID_SHOWONLY:
912  case DBID_MAXIMIZEBAND:
913  case DBID_PUSHCHEVRON:
914  FIXME("IOleCommandTarget::Exec(): Unsupported command ID %d\n", nCmdID);
915  return E_NOTIMPL;
916  default:
917  return E_FAIL;
918  }
919  return hRet;
920  }
921  else
922  WARN("IOleCommandTarget::Exec(): Unsupported command group GUID\n");
923 
924  return E_NOTIMPL;
925 }
Definition: compat.h:1947
#define WARN(fmt,...)
Definition: debug.h:111
#define E_FAIL
Definition: ddrawi.h:102
LONG lVal
Definition: compat.h:2042
HWND m_hwndRebar
Definition: CBandSite.h:55
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
HRESULT _UpdateAllBands()
Definition: CBandSite.cpp:212
#define E_NOTIMPL
Definition: ddrawi.h:99
VARTYPE vt
Definition: compat.h:2030
HRESULT _UpdateBand(struct BandObject *Band)
Definition: CBandSite.cpp:172
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ GetBandObject()

HRESULT STDMETHODCALLTYPE CBandSiteBase::GetBandObject ( DWORD  dwBandID,
REFIID  riid,
void **  ppv 
)
virtual

Implements IBandSite.

Definition at line 662 of file CBandSite.cpp.

663 {
664  struct BandObject *Band;
665 
666  TRACE("(%p, %u, %s, %p)\n", this, dwBandID, debugstr_guid(&riid), ppv);
667 
668  Band = _GetBandByID(dwBandID);
669  if (Band == NULL)
670  {
671  *ppv = NULL;
672  return E_FAIL;
673  }
674 
675  return Band->DeskBand->QueryInterface(riid, ppv);
676 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
struct BandObject * _GetBandByID(DWORD dwBandID)
Definition: CBandSite.cpp:54

◆ GetBandSiteInfo()

HRESULT STDMETHODCALLTYPE CBandSiteBase::GetBandSiteInfo ( BANDSITEINFO pbsinfo)
virtual

Implements IBandSite.

Definition at line 692 of file CBandSite.cpp.

693 {
694  if (!pbsinfo)
695  return E_INVALIDARG;
696 
697  if ((pbsinfo->dwMask & BSIM_STATE))
698  pbsinfo->dwState = m_dwState;
699  if ((pbsinfo->dwMask & BSIM_STYLE))
700  pbsinfo->dwStyle = m_dwStyle;
701 
702  return S_OK;
703 }
DWORD m_dwState
Definition: CBandSite.h:57
#define E_INVALIDARG
Definition: ddrawi.h:101
DWORD m_dwStyle
Definition: CBandSite.h:58
#define S_OK
Definition: intsafe.h:59

◆ GetClassID()

HRESULT STDMETHODCALLTYPE CBandSiteBase::GetClassID ( CLSID pClassID)
virtual

Implements IPersist.

Definition at line 952 of file CBandSite.cpp.

953 {
954  return E_NOTIMPL;
955 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetSize()

HRESULT STDMETHODCALLTYPE CBandSiteBase::GetSize ( DWORD  dwWhich,
LPRECT  prc 
)
virtual

Definition at line 871 of file CBandSite.cpp.

872 {
873  FIXME("(%p, %x, %p)\n", this, unknown1, unknown2);
874  return E_NOTIMPL;
875 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetSizeMax()

HRESULT STDMETHODCALLTYPE CBandSiteBase::GetSizeMax ( ULARGE_INTEGER pcbSize)
virtual

Implements IPersistStream.

Definition at line 972 of file CBandSite.cpp.

973 {
974  return E_NOTIMPL;
975 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetWindow()

HRESULT STDMETHODCALLTYPE CBandSiteBase::GetWindow ( HWND lphwnd)
virtual

Definition at line 777 of file CBandSite.cpp.

778 {
779  TRACE("(%p, %p)\n", this, phWnd);
780 
781  *phWnd = m_hwndRebar;
782  if (m_hwndRebar != NULL)
783  return S_OK;
784 
785  return E_FAIL;
786 }
#define E_FAIL
Definition: ddrawi.h:102
HWND m_hwndRebar
Definition: CBandSite.h:55
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ HasFocusIO()

HRESULT STDMETHODCALLTYPE CBandSiteBase::HasFocusIO ( )
virtual

Definition at line 932 of file CBandSite.cpp.

933 {
934  return E_NOTIMPL;
935 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ IsDirty()

HRESULT STDMETHODCALLTYPE CBandSiteBase::IsDirty ( void  )
virtual

Implements IPersistStream.

Definition at line 957 of file CBandSite.cpp.

958 {
959  return E_NOTIMPL;
960 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ IsWindowOwner()

HRESULT STDMETHODCALLTYPE CBandSiteBase::IsWindowOwner ( HWND  hWnd)
virtual

Definition at line 761 of file CBandSite.cpp.

762 {
763  struct BandObject *Band;
764 
765  TRACE("(%p, %p)\n", this, hWnd);
766 
767  if (m_hwndRebar == NULL)
768  return E_FAIL;
769 
770  Band = _GetBandFromHwnd(hWnd);
771  if (Band != NULL)
772  return S_OK;
773 
774  return S_FALSE;
775 }
HWND hWnd
Definition: settings.c:17
struct BandObject * _GetBandFromHwnd(HWND hwnd)
Definition: CBandSite.cpp:357
#define E_FAIL
Definition: ddrawi.h:102
HWND m_hwndRebar
Definition: CBandSite.h:55
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ Load()

HRESULT STDMETHODCALLTYPE CBandSiteBase::Load ( IStream pStm)
virtual

Implements IPersistStream.

Definition at line 962 of file CBandSite.cpp.

963 {
964  return E_NOTIMPL;
965 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ LoadFromStreamBS()

HRESULT STDMETHODCALLTYPE CBandSiteBase::LoadFromStreamBS ( IStream ,
const GUID ,
void **   
)
virtual

Definition at line 998 of file CBandSite.cpp.

999 {
1000  return E_NOTIMPL;
1001 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ OnFocusChangeIS()

HRESULT STDMETHODCALLTYPE CBandSiteBase::OnFocusChangeIS ( struct IUnknown paramC,
int  param10 
)
virtual

Definition at line 942 of file CBandSite.cpp.

943 {
944  return E_NOTIMPL;
945 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ OnWinEvent()

HRESULT STDMETHODCALLTYPE CBandSiteBase::OnWinEvent ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
LRESULT theResult 
)
virtual

Definition at line 705 of file CBandSite.cpp.

706 {
707  struct BandObject *Band;
708 
709  TRACE("(%p, %p, %u, %p, %p, %p)\n", this, hWnd, uMsg, wParam, lParam, plrResult);
710 
711  if (plrResult)
712  *plrResult = 0;
713  if (m_hwndRebar == NULL)
714  return E_FAIL;
715 
716  if (uMsg == WM_CONTEXTMENU)
717  {
718  HRESULT hr = _OnContextMenu(hWnd, uMsg, wParam, lParam, plrResult);
719  if (FAILED_UNEXPECTEDLY(hr))
720  return hr;
721 
722  return S_OK;
723  }
724  else if (uMsg == WM_COMMAND && lParam)
725  {
726  hWnd = reinterpret_cast<HWND>(lParam);
727  }
728  else if (uMsg == WM_NOTIFY)
729  {
730  NMHDR* pnmhdr = reinterpret_cast<NMHDR*>(lParam);
731  if (pnmhdr->hwndFrom != m_hwndRebar)
732  {
733  hWnd = pnmhdr->hwndFrom;
734  }
735  else
736  {
737  for (int i = 0; i < m_cBandsAllocated; i++)
738  {
739  if (m_bands[i].WndEvtHandler && m_bands[i].OleWindow)
740  {
741  HWND hwndBand;
742  if (SUCCEEDED(m_bands[i].OleWindow->GetWindow(&hwndBand)))
743  {
744  m_bands[i].WndEvtHandler->OnWinEvent(hwndBand, uMsg, wParam, lParam, plrResult);
745  }
746  }
747  }
748  return S_OK;
749  }
750  }
751 
752  Band = _GetBandFromHwnd(hWnd);
753  if (Band != NULL)
754  {
755  return Band->WndEvtHandler->OnWinEvent(hWnd, uMsg, wParam, lParam, plrResult);
756  }
757 
758  return E_FAIL;
759 }
#define WM_CONTEXTMENU
Definition: richedit.h:64
HRESULT hr
Definition: shlfolder.c:183
struct BandObject * m_bands
Definition: CBandSite.h:54
HWND hWnd
Definition: settings.c:17
struct BandObject * _GetBandFromHwnd(HWND hwnd)
Definition: CBandSite.cpp:357
#define E_FAIL
Definition: ddrawi.h:102
WPARAM wParam
Definition: combotst.c:138
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HWND m_hwndRebar
Definition: CBandSite.h:55
smooth NULL
Definition: ftsmooth.c:416
HRESULT _OnContextMenu(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plrResult)
Definition: CBandSite.cpp:258
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define WM_COMMAND
Definition: winuser.h:1722
HWND hwndFrom
Definition: winuser.h:3132
LONG m_cBandsAllocated
Definition: CBandSite.h:53
#define S_OK
Definition: intsafe.h:59
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ QueryBand()

HRESULT STDMETHODCALLTYPE CBandSiteBase::QueryBand ( DWORD  dwBandID,
IDeskBand **  ppstb,
DWORD pdwState,
LPWSTR  pszName,
int  cchName 
)
virtual

Implements IBandSite.

Definition at line 588 of file CBandSite.cpp.

590 {
591  struct BandObject *Band;
592 
593  TRACE("(%p, %u, %p, %p, %p, %d)\n", this, dwBandID, ppstb, pdwState, pszName, cchName);
594 
595  Band = _GetBandByID(dwBandID);
596  if (Band == NULL)
597  return E_FAIL;
598 
599  if (ppstb != NULL)
600  {
601  Band->DeskBand->AddRef();
602  *ppstb = Band->DeskBand;
603  }
604 
605  if (pdwState != NULL)
606  {
607  FIXME("IBandSite::QueryBand() requests band state!\n");
608  *pdwState = 0;
609  }
610 
611  if (pszName != NULL && cchName > 0)
612  {
613  FIXME("IBandSite::QueryBand() requests band name!\n");
614  pszName[0] = 0;
615  }
616  return S_OK;
617 }
#define E_FAIL
Definition: ddrawi.h:102
_In_ PSID _Out_writes_to_opt_ cchName LPSTR _Inout_ LPDWORD cchName
Definition: winbase.h:2723
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
struct BandObject * _GetBandByID(DWORD dwBandID)
Definition: CBandSite.cpp:54

◆ QueryService()

HRESULT STDMETHODCALLTYPE CBandSiteBase::QueryService ( REFGUID  guidService,
REFIID  riid,
void **  ppvObject 
)
virtual

Implements IServiceProvider.

Definition at line 947 of file CBandSite.cpp.

948 {
949  return E_NOTIMPL;
950 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ QueryStatus()

HRESULT STDMETHODCALLTYPE CBandSiteBase::QueryStatus ( const GUID pguidCmdGroup,
ULONG  cCmds,
OLECMD  prgCmds[],
OLECMDTEXT pCmdText 
)
virtual

Implements IOleCommandTarget.

Definition at line 877 of file CBandSite.cpp.

879 {
880  FIXME("(%p, %p, %u, %p, %p)\n", this, pguidCmdGroup, cCmds, prgCmds, pCmdText);
881  return E_NOTIMPL;
882 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ RemoveBand()

HRESULT STDMETHODCALLTYPE CBandSiteBase::RemoveBand ( DWORD  dwBandID)
virtual

Implements IBandSite.

Definition at line 633 of file CBandSite.cpp.

634 {
635  struct BandObject *Band;
636  UINT uBand;
637 
638  TRACE("(%p, %u)\n", this, dwBandID);
639 
640  if (m_hwndRebar == NULL)
641  return E_FAIL;
642 
643  Band = _GetBandByID(dwBandID);
644  if (Band == NULL)
645  return E_FAIL;
646 
648  if (uBand != (UINT)-1)
649  {
650  if (!SendMessageW(m_hwndRebar, RB_DELETEBAND, (WPARAM)uBand, 0))
651  {
652  ERR("Could not delete band!\n");
653  }
654  }
655  else
656  ERR("Could not map band id to index!\n");
657 
658  _FreeBand(Band);
659  return S_OK;
660 }
UINT_PTR WPARAM
Definition: windef.h:207
#define E_FAIL
Definition: ddrawi.h:102
void _FreeBand(struct BandObject *Band)
Definition: CBandSite.cpp:65
HWND m_hwndRebar
Definition: CBandSite.h:55
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define ERR(fmt,...)
Definition: debug.h:109
UINT _GetBandID(struct BandObject *Band)
Definition: CBandSite.cpp:49
#define S_OK
Definition: intsafe.h:59
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define RB_IDTOINDEX
Definition: commctrl.h:1584
unsigned int UINT
Definition: ndis.h:50
struct BandObject * _GetBandByID(DWORD dwBandID)
Definition: CBandSite.cpp:54
#define RB_DELETEBAND
Definition: commctrl.h:1572

Referenced by _OnContextMenu().

◆ Save()

HRESULT STDMETHODCALLTYPE CBandSiteBase::Save ( IStream pStm,
BOOL  fClearDirty 
)
virtual

Implements IPersistStream.

Definition at line 967 of file CBandSite.cpp.

968 {
969  return E_NOTIMPL;
970 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ SaveToStreamBS()

HRESULT STDMETHODCALLTYPE CBandSiteBase::SaveToStreamBS ( IUnknown ,
IStream  
)
virtual

Definition at line 1003 of file CBandSite.cpp.

1004 {
1005  return E_NOTIMPL;
1006 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ SetBandSiteInfo()

HRESULT STDMETHODCALLTYPE CBandSiteBase::SetBandSiteInfo ( const BANDSITEINFO pbsinfo)
virtual

Implements IBandSite.

Definition at line 678 of file CBandSite.cpp.

679 {
680  if (!pbsinfo)
681  return E_INVALIDARG;
682 
683  if ((pbsinfo->dwMask & BSIM_STATE))
684  m_dwState = pbsinfo->dwState;
685  if ((pbsinfo->dwMask & BSIM_STYLE))
686  m_dwStyle = pbsinfo->dwStyle;
687 
688  _UpdateAllBands();
689  return S_OK;
690 }
DWORD m_dwState
Definition: CBandSite.h:57
#define E_INVALIDARG
Definition: ddrawi.h:101
DWORD m_dwStyle
Definition: CBandSite.h:58
#define S_OK
Definition: intsafe.h:59
HRESULT _UpdateAllBands()
Definition: CBandSite.cpp:212

◆ SetBandState()

HRESULT STDMETHODCALLTYPE CBandSiteBase::SetBandState ( DWORD  dwBandID,
DWORD  dwMask,
DWORD  dwState 
)
virtual

Implements IBandSite.

Definition at line 619 of file CBandSite.cpp.

620 {
621  struct BandObject *Band;
622 
623  TRACE("(%p, %u, %x, %x)\n", this, dwBandID, dwMask, dwState);
624 
625  Band = _GetBandByID(dwBandID);
626  if (Band == NULL)
627  return E_FAIL;
628 
629  FIXME("Stub\n");
630  return E_NOTIMPL;
631 }
#define E_FAIL
Definition: ddrawi.h:102
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define E_NOTIMPL
Definition: ddrawi.h:99
struct BandObject * _GetBandByID(DWORD dwBandID)
Definition: CBandSite.cpp:54

◆ SetDeskBarSite()

HRESULT STDMETHODCALLTYPE CBandSiteBase::SetDeskBarSite ( IUnknown punkSite)
virtual

Definition at line 794 of file CBandSite.cpp.

795 {
797  HRESULT hRet;
798  DWORD style;
799 
800  TRACE("(%p, %p)\n", this, pUnk);
801 
802  m_site = NULL;
803 
805  if (FAILED_UNEXPECTEDLY(hRet))
806  return E_FAIL;
807 
808  hRet = m_site->GetWindow(&hWndParent);
809  if (FAILED_UNEXPECTEDLY(hRet))
810  return E_FAIL;
811 
813  RBS_BANDBORDERS | CCS_NODIVIDER | /*CCS_NORESIZE |*/ CCS_NOPARENTALIGN;
814 
817  NULL,
818  style,
819  0, 0, 0, 0,
820  hWndParent,
821  NULL,
822  _AtlBaseModule.GetModuleInstance(),
823  NULL);
824  if (m_hwndRebar == NULL)
825  {
826  m_site = NULL;
827  WARN("IDeskbarClient::SetDeskBarSite() failed to create ReBar control!\n");
828  return E_FAIL;
829  }
830 
831  return S_OK;
832 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define RBS_VARHEIGHT
Definition: commctrl.h:1467
#define WARN(fmt,...)
Definition: debug.h:111
#define WS_CHILD
Definition: pedump.c:617
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define RBS_BANDBORDERS
Definition: commctrl.h:1468
#define REBARCLASSNAMEW
Definition: commctrl.h:1459
#define CCS_NODIVIDER
Definition: commctrl.h:2244
HWND m_hwndRebar
Definition: CBandSite.h:55
smooth NULL
Definition: ftsmooth.c:416
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2242
#define RBS_AUTOSIZE
Definition: commctrl.h:1471
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define S_OK
Definition: intsafe.h:59
CComPtr< IOleWindow > m_site
Definition: CBandSite.h:56
nsresult QueryInterface(nsIIDRef riid, void **result)
Arabic default style
Definition: afstyles.h:93
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30

◆ SetModeDBC()

HRESULT STDMETHODCALLTYPE CBandSiteBase::SetModeDBC ( DWORD  dwMode)
virtual

Definition at line 834 of file CBandSite.cpp.

835 {
836  LONG dwStyle;
837  LONG dwPrevStyle;
838 
839  TRACE("(%p, %x)\n", this, dwMode);
840 
841  if (m_hwndRebar == NULL)
842  return E_FAIL;
843 
844  dwStyle = dwPrevStyle = GetWindowLongPtr(m_hwndRebar, GWL_STYLE);
845  if (dwMode & DBIF_VIEWMODE_VERTICAL)
846  dwStyle |= CCS_VERT;
847 
848  if (dwMode & ~DBIF_VIEWMODE_VERTICAL)
849  FIXME("IDeskBarClient::SetModeDBC() unhandled modes: %x\n", dwStyle & ~DBIF_VIEWMODE_VERTICAL);
850 
851  if (dwStyle != dwPrevStyle)
852  {
853  SetWindowLongPtr(m_hwndRebar, GWL_STYLE, dwPrevStyle);
854  }
855 
856  return S_OK;
857 }
#define E_FAIL
Definition: ddrawi.h:102
#define SetWindowLongPtr
Definition: treelist.c:70
#define CCS_VERT
Definition: commctrl.h:2245
long LONG
Definition: pedump.c:60
HWND m_hwndRebar
Definition: CBandSite.h:55
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GWL_STYLE
Definition: winuser.h:846
#define S_OK
Definition: intsafe.h:59
#define GetWindowLongPtr
Definition: treelist.c:73

◆ TranslateAcceleratorIO()

HRESULT STDMETHODCALLTYPE CBandSiteBase::TranslateAcceleratorIO ( LPMSG  lpMsg)
virtual

Definition at line 937 of file CBandSite.cpp.

938 {
939  return E_NOTIMPL;
940 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ UIActivateDBC()

HRESULT STDMETHODCALLTYPE CBandSiteBase::UIActivateDBC ( DWORD  dwState)
virtual

Definition at line 859 of file CBandSite.cpp.

860 {
861  TRACE("(%p, %x)\n", this, dwState);
862 
863  if (m_hwndRebar == NULL)
864  return E_FAIL;
865 
866  ShowWindow(m_hwndRebar, (dwState & DBC_SHOW) ? SW_SHOW : SW_HIDE);
867  //FIXME: Properly notify bands?
868  return S_OK;
869 }
#define DBC_SHOW
Definition: shlobj.h:973
#define SW_HIDE
Definition: winuser.h:762
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define E_FAIL
Definition: ddrawi.h:102
HWND m_hwndRebar
Definition: CBandSite.h:55
smooth NULL
Definition: ftsmooth.c:416
#define SW_SHOW
Definition: winuser.h:769
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ UIActivateIO()

HRESULT STDMETHODCALLTYPE CBandSiteBase::UIActivateIO ( BOOL  fActivate,
LPMSG  lpMsg 
)
virtual

Definition at line 927 of file CBandSite.cpp.

928 {
929  return E_NOTIMPL;
930 }
#define E_NOTIMPL
Definition: ddrawi.h:99

Member Data Documentation

◆ m_bands

struct BandObject* CBandSiteBase::m_bands
private

◆ m_cBands

LONG CBandSiteBase::m_cBands
private

Definition at line 52 of file CBandSite.h.

Referenced by _FreeBand(), AddBand(), and EnumBands().

◆ m_cBandsAllocated

LONG CBandSiteBase::m_cBandsAllocated
private

◆ m_dwState

DWORD CBandSiteBase::m_dwState
private

Definition at line 57 of file CBandSite.h.

Referenced by GetBandSiteInfo(), and SetBandSiteInfo().

◆ m_dwStyle

DWORD CBandSiteBase::m_dwStyle
private

Definition at line 58 of file CBandSite.h.

Referenced by _BuildBandInfo(), _OnContextMenu(), GetBandSiteInfo(), and SetBandSiteInfo().

◆ m_hwndRebar

◆ m_site

CComPtr<IOleWindow> CBandSiteBase::m_site
private

Definition at line 56 of file CBandSite.h.

Referenced by SetDeskBarSite().


The documentation for this class was generated from the following files: