ReactOS 0.4.15-dev-8096-ga0eec98
CBandSiteBase Class Reference

#include <CBandSite.h>

Inheritance diagram for CBandSiteBase:
Collaboration diagram for CBandSiteBase:

Classes

struct  BandObject
 

Public Member Functions

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

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),
44 m_dwState(0),
45 m_dwStyle(0)
46{
47}
DWORD m_dwStyle
Definition: CBandSite.h:58
struct BandObject * m_bands
Definition: CBandSite.h:54
LONG m_cBands
Definition: CBandSite.h:52
LONG m_cBandsAllocated
Definition: CBandSite.h:53
DWORD m_dwState
Definition: CBandSite.h:57
HWND m_hwndRebar
Definition: CBandSite.h:55
#define NULL
Definition: types.h:112

◆ ~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 {
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)
396 }
398 m_bands = NULL;
399 }
400}
void _FreeBand(struct BandObject *Band)
Definition: CBandSite.cpp:65
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 WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define TRACE(s)
Definition: solgame.cpp:4
int32_t INT
Definition: typedefs.h:58
BOOL WINAPI DestroyWindow(_In_ HWND)

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)
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}
UINT _GetBandID(struct BandObject *Band)
Definition: CBandSite.cpp:49
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define RBBS_HIDETITLE
#define RBBS_TOPALIGN
Definition: commctrl.h:1500
#define RBBS_BREAK
Definition: commctrl.h:1489
#define RBBIM_CHILDSIZE
Definition: commctrl.h:1507
#define RBBS_FIXEDBMP
Definition: commctrl.h:1494
#define RBBS_FIXEDSIZE
Definition: commctrl.h:1490
#define RBBS_NOGRIPPER
Definition: commctrl.h:1497
#define RBBS_CHILDEDGE
Definition: commctrl.h:1491
#define RBBIM_ID
Definition: commctrl.h:1510
#define RBBIM_STYLE
Definition: commctrl.h:1502
#define RBBIM_SIZE
Definition: commctrl.h:1508
#define RBBIM_TEXT
Definition: commctrl.h:1504
#define RBBIM_COLORS
Definition: commctrl.h:1503
#define RBBS_USECHEVRON
Definition: commctrl.h:1498
#define RBBS_GRIPPERALWAYS
Definition: commctrl.h:1496
#define RBBS_VARIABLEHEIGHT
Definition: commctrl.h:1495
#define RBBIM_IDEALSIZE
Definition: commctrl.h:1511
COLORREF clrBack
Definition: commctrl.h:1549
COLORREF clrFore
Definition: commctrl.h:1548
#define ZeroMemory
Definition: winbase.h:1712
DWORD COLORREF
Definition: windef.h:300
#define COLOR_WINDOWTEXT
Definition: winuser.h:921

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}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
#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}
long LONG
Definition: pedump.c:60

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}
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define ASSERT(a)
Definition: mode.c:44
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

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}
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}
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CCS_VERT
Definition: commctrl.h:2249
#define GetWindowLongPtr
Definition: treelist.c:73
#define GWL_STYLE
Definition: winuser.h:852

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 */
248 return hr;
249
250 DWORD dwState;
251 hr = pbs->QueryBand(dwBandID, NULL, &dwState, NULL, NULL);
253 return hr;
254
255 return ((dwState & BSSF_UNDELETEABLE) != 0) ? S_FALSE : S_OK;
256}
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define S_OK
Definition: intsafe.h:52
HRESULT hr
Definition: shlfolder.c:183
#define S_FALSE
Definition: winerror.h:2357
#define IID_PPV_ARG(Itype, ppType)

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);
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);
334 return hr;
335 }
336 else
337 {
338 if (uCommand == IDM_BAND_TITLE)
339 {
340 Band->bHiddenTitle = !Band->bHiddenTitle;
341
342 hr = _UpdateBand(dwBandID);
344 return hr;
345 }
346 else if(uCommand == IDM_BAND_CLOSE)
347 {
348 hr = RemoveBand(dwBandID);
350 return hr;
351 }
352 }
353
354 return S_OK;
355}
HRESULT _IsBandDeletable(DWORD dwBandID)
Definition: CBandSite.cpp:241
STDMETHOD() RemoveBand(DWORD dwBandID) override
Definition: CBandSite.cpp:633
struct BandObject * _GetBandByID(DWORD dwBandID)
Definition: CBandSite.cpp:54
HRESULT _UpdateBand(struct BandObject *Band)
Definition: CBandSite.cpp:172
LPARAM lParam
Definition: combotst.c:139
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_FAIL
Definition: ddrawi.h:102
#define IDM_BAND_CLOSE
Definition: resource.h:65
#define IDM_BAND_TITLE
Definition: resource.h:64
#define IDM_BAND_MENU
Definition: resource.h:63
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define UINT_MAX
Definition: limits.h:41
static const struct bandInfoStruct bandInfo[9]
Definition: layer3.c:95
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#define L(x)
Definition: ntvdm.h:50
#define RB_GETBANDINFOW
Definition: commctrl.h:1609
#define RB_HITTEST
Definition: commctrl.h:1581
UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
Definition: shlmenu.c:856
#define MM_SUBMENUSHAVEIDS
Definition: shlobj.h:2515
#define MM_DONTREMOVESEPS
Definition: shlobj.h:2516
LONG_PTR LPARAM
Definition: windef.h:208
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
#define HRESULT_CODE(hr)
Definition: winerror.h:76
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_CHECKED
Definition: winuser.h:132
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
#define MF_UNCHECKED
Definition: winuser.h:204
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define TPM_RETURNCMD
Definition: winuser.h:2387
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

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}

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

◆ _UpdateBand() [1/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}

◆ _UpdateBand() [2/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
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 WARN(fmt,...)
Definition: debug.h:115
VOID _BuildBandInfo(struct BandObject *Band, REBARBANDINFOW *prbi)
Definition: CBandSite.cpp:90
DWORD _GetViewMode()
Definition: CBandSite.cpp:77
#define RB_SETBANDINFOW
Definition: commctrl.h:1584
#define RBBIM_CHILD
Definition: commctrl.h:1506
#define RB_IDTOINDEX
Definition: commctrl.h:1588
UINT_PTR WPARAM
Definition: windef.h:207

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

◆ AddBand()

HRESULT STDMETHODCALLTYPE CBandSiteBase::AddBand ( IUnknown punk)
override

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
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
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);
541 if (uBand != (UINT)-1)
542 {
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 ERR(fmt,...)
Definition: debug.h:113
HRESULT _UpdateAllBands()
Definition: CBandSite.cpp:212
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned short USHORT
Definition: pedump.c:61
#define RB_DELETEBAND
Definition: commctrl.h:1576
#define RB_INSERTBANDW
Definition: commctrl.h:1583
#define HRESULT
Definition: msvc.h:7

◆ ContextSensitiveHelp()

HRESULT STDMETHODCALLTYPE CBandSiteBase::ContextSensitiveHelp ( BOOL  fEnterMode)
override

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:114
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DragEnter()

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

Implements IDropTarget.

Definition at line 977 of file CBandSite.cpp.

979{
980 return E_NOTIMPL;
981}

◆ DragLeave()

HRESULT STDMETHODCALLTYPE CBandSiteBase::DragLeave ( void  )
override

Implements IDropTarget.

Definition at line 988 of file CBandSite.cpp.

989{
990 return E_NOTIMPL;
991}

◆ DragOver()

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

Implements IDropTarget.

Definition at line 983 of file CBandSite.cpp.

984{
985 return E_NOTIMPL;
986}

◆ Drop()

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

Implements IDropTarget.

Definition at line 993 of file CBandSite.cpp.

994{
995 return E_NOTIMPL;
996}

◆ EnumBands()

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

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}
#define DWORD
Definition: nt_native.h:44

◆ Exec()

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

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:
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}
@ VT_I4
Definition: compat.h:2298
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
@ DBID_PUSHCHEVRON
Definition: shobjidl.idl:2455
@ DBID_BANDINFOCHANGED
Definition: shobjidl.idl:2452
@ DBID_MAXIMIZEBAND
Definition: shobjidl.idl:2454
@ DBID_SHOWONLY
Definition: shobjidl.idl:2453
LONG lVal
Definition: compat.h:2393
VARTYPE vt
Definition: compat.h:2381

◆ GetBandObject()

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

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: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35

◆ GetBandSiteInfo()

HRESULT STDMETHODCALLTYPE CBandSiteBase::GetBandSiteInfo ( BANDSITEINFO pbsinfo)
override

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}
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ GetClassID()

HRESULT STDMETHODCALLTYPE CBandSiteBase::GetClassID ( CLSID pClassID)
override

Implements IPersist.

Definition at line 952 of file CBandSite.cpp.

953{
954 return E_NOTIMPL;
955}

◆ GetSize()

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

Definition at line 871 of file CBandSite.cpp.

872{
873 FIXME("(%p, %x, %p)\n", this, unknown1, unknown2);
874 return E_NOTIMPL;
875}

◆ GetSizeMax()

HRESULT STDMETHODCALLTYPE CBandSiteBase::GetSizeMax ( ULARGE_INTEGER pcbSize)
override

Implements IPersistStream.

Definition at line 972 of file CBandSite.cpp.

973{
974 return E_NOTIMPL;
975}

◆ GetWindow()

HRESULT STDMETHODCALLTYPE CBandSiteBase::GetWindow ( HWND lphwnd)
override

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}

◆ HasFocusIO()

HRESULT STDMETHODCALLTYPE CBandSiteBase::HasFocusIO ( )
override

Definition at line 932 of file CBandSite.cpp.

933{
934 return E_NOTIMPL;
935}

◆ IsDirty()

HRESULT STDMETHODCALLTYPE CBandSiteBase::IsDirty ( void  )
override

Implements IPersistStream.

Definition at line 957 of file CBandSite.cpp.

958{
959 return E_NOTIMPL;
960}

◆ IsWindowOwner()

HRESULT STDMETHODCALLTYPE CBandSiteBase::IsWindowOwner ( HWND  hWnd)
override

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

◆ Load()

HRESULT STDMETHODCALLTYPE CBandSiteBase::Load ( IStream pStm)
override

Implements IPersistStream.

Definition at line 962 of file CBandSite.cpp.

963{
964 return E_NOTIMPL;
965}

◆ LoadFromStreamBS()

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

Definition at line 998 of file CBandSite.cpp.

999{
1000 return E_NOTIMPL;
1001}

◆ OnFocusChangeIS()

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

Definition at line 942 of file CBandSite.cpp.

943{
944 return E_NOTIMPL;
945}

◆ OnWinEvent()

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

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);
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}
HRESULT _OnContextMenu(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plrResult)
Definition: CBandSite.cpp:258
WPARAM wParam
Definition: combotst.c:138
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_NOTIFY
Definition: richedit.h:61
HWND hwndFrom
Definition: winuser.h:3157
#define WM_COMMAND
Definition: winuser.h:1740

◆ QueryBand()

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

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}
_In_ PSID _Out_writes_to_opt_ cchName LPSTR _Inout_ LPDWORD cchName
Definition: winbase.h:2767

◆ QueryService()

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

Implements IServiceProvider.

Definition at line 947 of file CBandSite.cpp.

948{
949 return E_NOTIMPL;
950}

◆ QueryStatus()

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

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}

◆ RemoveBand()

HRESULT STDMETHODCALLTYPE CBandSiteBase::RemoveBand ( DWORD  dwBandID)
override

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 {
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}

Referenced by _OnContextMenu().

◆ Save()

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

Implements IPersistStream.

Definition at line 967 of file CBandSite.cpp.

968{
969 return E_NOTIMPL;
970}

◆ SaveToStreamBS()

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

Definition at line 1003 of file CBandSite.cpp.

1004{
1005 return E_NOTIMPL;
1006}

◆ SetBandSiteInfo()

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

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
689 return S_OK;
690}

◆ SetBandState()

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

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}

◆ SetDeskBarSite()

HRESULT STDMETHODCALLTYPE CBandSiteBase::SetDeskBarSite ( IUnknown punkSite)
override

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,
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}
Arabic default style
Definition: afstyles.h:94
CComPtr< IOleWindow > m_site
Definition: CBandSite.h:56
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
nsresult QueryInterface(nsIIDRef riid, void **result)
#define WS_CHILD
Definition: pedump.c:617
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define REBARCLASSNAMEW
Definition: commctrl.h:1463
#define RBS_BANDBORDERS
Definition: commctrl.h:1472
#define RBS_AUTOSIZE
Definition: commctrl.h:1475
#define CCS_NODIVIDER
Definition: commctrl.h:2248
#define RBS_VARHEIGHT
Definition: commctrl.h:1471
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2246
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
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)

◆ SetModeDBC()

HRESULT STDMETHODCALLTYPE CBandSiteBase::SetModeDBC ( DWORD  dwMode)
override

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 {
854 }
855
856 return S_OK;
857}
#define SetWindowLongPtr
Definition: treelist.c:70

◆ TranslateAcceleratorIO()

HRESULT STDMETHODCALLTYPE CBandSiteBase::TranslateAcceleratorIO ( LPMSG  lpMsg)
override

Definition at line 937 of file CBandSite.cpp.

938{
939 return E_NOTIMPL;
940}

◆ UIActivateDBC()

HRESULT STDMETHODCALLTYPE CBandSiteBase::UIActivateDBC ( DWORD  dwState)
override

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
867 //FIXME: Properly notify bands?
868 return S_OK;
869}
#define DBC_SHOW
Definition: shlobj.h:1048
#define SW_HIDE
Definition: winuser.h:768
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SW_SHOW
Definition: winuser.h:775

◆ UIActivateIO()

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

Definition at line 927 of file CBandSite.cpp.

928{
929 return E_NOTIMPL;
930}

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: