ReactOS 0.4.15-dev-6679-g945ee4b
CBrandBand Class Reference

#include <brandband.h>

Inheritance diagram for CBrandBand:
Collaboration diagram for CBrandBand:

Public Member Functions

 CBrandBand ()
 
 ~CBrandBand ()
 
void StartAnimation ()
 
void StopAnimation ()
 
void SelectImage ()
 
virtual HRESULT STDMETHODCALLTYPE GetBandInfo (DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi)
 
virtual HRESULT STDMETHODCALLTYPE SetSite (IUnknown *pUnkSite)
 
virtual HRESULT STDMETHODCALLTYPE GetSite (REFIID riid, void **ppvSite)
 
virtual HRESULT STDMETHODCALLTYPE GetWindow (HWND *lphwnd)
 
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp (BOOL fEnterMode)
 
virtual HRESULT STDMETHODCALLTYPE CloseDW (DWORD dwReserved)
 
virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW (const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved)
 
virtual HRESULT STDMETHODCALLTYPE ShowDW (BOOL fShow)
 
virtual HRESULT STDMETHODCALLTYPE HasFocusIO ()
 
virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO (LPMSG lpMsg)
 
virtual HRESULT STDMETHODCALLTYPE UIActivateIO (BOOL fActivate, LPMSG lpMsg)
 
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 OnWinEvent (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
 
virtual HRESULT STDMETHODCALLTYPE IsWindowOwner (HWND hWnd)
 
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 QueryService (REFGUID guidService, REFIID riid, void **ppvObject)
 
virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount (UINT *pctinfo)
 
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo (UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames (REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
virtual HRESULT STDMETHODCALLTYPE Invoke (DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
LRESULT OnSize (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnEraseBkgnd (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnPaint (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnTimer (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
- 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 GetBandInfo ([in] DWORD dwBandID, [in] DWORD dwViewMode, [in, out] DESKBANDINFO *pdbi)
 
- Public Member Functions inherited from IDockingWindow
HRESULT ShowDW ([in] BOOL fShow)
 
HRESULT CloseDW ([in] DWORD dwReserved)
 
HRESULT ResizeBorderDW ([in] LPCRECT prcBorder, [in] IUnknown *punkToolbarSite, [in] BOOL fReserved)
 
HRESULT GetWindow ([out] HWND *phwnd)
 
HRESULT ContextSensitiveHelp ([in] BOOL fEnterMode)
 
- 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 IObjectWithSite
HRESULT SetSite ([in] IUnknown *pUnkSite)
 
HRESULT GetSite ([in] REFIID riid, [out, iid_is(riid)] PVOID *ppvSite)
 
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 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)
 
- 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)
 
- Public Member Functions inherited from IDispatch
HRESULT GetTypeInfoCount ([out] UINT *pctinfo)
 
HRESULT GetTypeInfo ([in] UINT iTInfo, [in] LCID lcid, [out] ITypeInfo **ppTInfo)
 
HRESULT GetIDsOfNames ([in] REFIID riid, [in, size_is(cNames)] LPOLESTR *rgszNames, [in] UINT cNames, [in] LCID lcid, [out, size_is(cNames)] DISPID *rgDispId)
 
HRESULT Invoke ([in] DISPID dispIdMember, [in] REFIID riid, [in] LCID lcid, [in] WORD wFlags, [in, out] DISPPARAMS *pDispParams, [out] VARIANT *pVarResult, [out] EXCEPINFO *pExcepInfo, [out] UINT *puArgErr)
 
HRESULT RemoteInvoke ([in] DISPID dispIdMember, [in] REFIID riid, [in] LCID lcid, [in] DWORD dwFlags, [in] DISPPARAMS *pDispParams, [out] VARIANT *pVarResult, [out] EXCEPINFO *pExcepInfo, [out] UINT *pArgErr, [in] UINT cVarRef, [in, size_is(cVarRef)] UINT *rgVarRefIdx, [in, out, size_is(cVarRef)] VARIANTARG *rgVarRef)
 

Private Attributes

CComPtr< IDockingWindowSite > fSite
 
DWORD fProfferCookie
 
int fCurrentFrame
 
int fMaxFrameCount
 
HBITMAP fImageBitmap
 
int fBitmapSize
 
DWORD fAdviseCookie
 

Additional Inherited Members

- Public Types inherited from IOleWindow
typedef IOleWindowLPOLEWINDOW
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IObjectWithSite
typedef IObjectWithSiteLPOBJECTWITHSITE
 
- Public Types inherited from IPersistStream
typedef IPersistStreamLPPERSISTSTREAM
 
- Public Types inherited from IPersist
typedef IPersistLPPERSIST
 
- 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
 
- Public Types inherited from IServiceProvider
typedef IServiceProviderLPSERVICEPROVIDER
 
- Public Types inherited from IDispatch
typedef IDispatchLPDISPATCH
 
- 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 IDispatch
const DISPID DISPID_UNKNOWN = -1
 
const DISPID DISPID_VALUE = 0
 
const DISPID DISPID_PROPERTYPUT = -3
 
const DISPID DISPID_NEWENUM = -4
 
const DISPID DISPID_EVALUATE = -5
 
const DISPID DISPID_CONSTRUCTOR = -6
 
const DISPID DISPID_DESTRUCTOR = -7
 
const DISPID DISPID_COLLECT = -8
 

Detailed Description

Definition at line 23 of file brandband.h.

Constructor & Destructor Documentation

◆ CBrandBand()

CBrandBand::CBrandBand ( )

Definition at line 53 of file brandband.cpp.

54{
56 fCurrentFrame = 0;
59 fBitmapSize = 0;
60 fAdviseCookie = 0;
61}
HBITMAP fImageBitmap
Definition: brandband.h:41
DWORD fProfferCookie
Definition: brandband.h:38
int fBitmapSize
Definition: brandband.h:42
int fMaxFrameCount
Definition: brandband.h:40
DWORD fAdviseCookie
Definition: brandband.h:43
int fCurrentFrame
Definition: brandband.h:39
#define NULL
Definition: types.h:112

◆ ~CBrandBand()

CBrandBand::~CBrandBand ( )

Definition at line 63 of file brandband.cpp.

64{
66}
pKey DeleteObject()

Member Function Documentation

◆ CloseDW()

HRESULT STDMETHODCALLTYPE CBrandBand::CloseDW ( DWORD  dwReserved)
virtual

Implements IDockingWindow.

Definition at line 223 of file brandband.cpp.

224{
225 ShowDW(FALSE);
226
227 if (IsWindow())
229
230 m_hWnd = NULL;
231
232 return S_OK;
233}
virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow)
Definition: brandband.cpp:241
#define FALSE
Definition: types.h:117
#define S_OK
Definition: intsafe.h:52
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)

◆ ContextSensitiveHelp()

HRESULT STDMETHODCALLTYPE CBrandBand::ContextSensitiveHelp ( BOOL  fEnterMode)
virtual

Implements IOleWindow.

Definition at line 218 of file brandband.cpp.

219{
220 return E_NOTIMPL;
221}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Exec()

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

Implements IOleCommandTarget.

Definition at line 317 of file brandband.cpp.

319{
320 if (IsEqualIID(*pguidCmdGroup, CGID_PrivCITCommands))
321 {
322 }
323 else if (IsEqualIID(*pguidCmdGroup, CGID_BrandCmdGroup))
324 {
325 switch (nCmdID)
326 {
329 return S_OK;
332 return S_OK;
333 }
334 }
335 return E_FAIL;
336}
void StopAnimation()
Definition: brandband.cpp:74
void StartAnimation()
Definition: brandband.cpp:68
#define E_FAIL
Definition: ddrawi.h:102
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define BBID_STARTANIMATION
Definition: undocshell.h:727
#define BBID_STOPANIMATION
Definition: undocshell.h:728

◆ GetBandInfo()

HRESULT STDMETHODCALLTYPE CBrandBand::GetBandInfo ( DWORD  dwBandID,
DWORD  dwViewMode,
DESKBANDINFO pdbi 
)
virtual

Implements IDeskBand.

Definition at line 110 of file brandband.cpp.

111{
112 if (pdbi->dwMask & DBIM_MINSIZE)
113 {
114 pdbi->ptMinSize.x = 38;
115 pdbi->ptMinSize.y = 22;
116 }
117 if (pdbi->dwMask & DBIM_MAXSIZE)
118 {
119 pdbi->ptMaxSize.x = 38;
120 pdbi->ptMaxSize.y = 38;
121 }
122 if (pdbi->dwMask & DBIM_INTEGRAL)
123 {
124 pdbi->ptIntegral.x = 38;
125 pdbi->ptIntegral.y = 38;
126 }
127 if (pdbi->dwMask & DBIM_ACTUAL)
128 {
129 pdbi->ptActual.x = 38;
130 pdbi->ptActual.y = 38;
131 }
132 if (pdbi->dwMask & DBIM_TITLE)
133 wcscpy(pdbi->wszTitle, L"");
134 if (pdbi->dwMask & DBIM_MODEFLAGS)
135 pdbi->dwModeFlags = DBIMF_UNDELETEABLE;
136 if (pdbi->dwMask & DBIM_BKCOLOR)
137 pdbi->crBkgnd = 0;
138 return S_OK;
139}
#define L(x)
Definition: ntvdm.h:50
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329
COLORREF crBkgnd
Definition: shobjidl.idl:2382
WCHAR wszTitle[256]
Definition: shobjidl.idl:2380

◆ GetClassID()

HRESULT STDMETHODCALLTYPE CBrandBand::GetClassID ( CLSID pClassID)
virtual

Implements IPersist.

Definition at line 270 of file brandband.cpp.

271{
272 if (pClassID == NULL)
273 return E_POINTER;
274 *pClassID = CLSID_BrandBand;
275 return S_OK;
276}
#define E_POINTER
Definition: winerror.h:2365

◆ GetIDsOfNames()

HRESULT STDMETHODCALLTYPE CBrandBand::GetIDsOfNames ( REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
virtual

Implements IDispatch.

Definition at line 361 of file brandband.cpp.

363{
364 return E_NOTIMPL;
365}

◆ GetSite()

HRESULT STDMETHODCALLTYPE CBrandBand::GetSite ( REFIID  riid,
void **  ppvSite 
)
virtual

Definition at line 198 of file brandband.cpp.

199{
200 if (ppvSite == NULL)
201 return E_POINTER;
202 if (fSite.p == NULL)
203 {
204 *ppvSite = NULL;
205 return E_FAIL;
206 }
207 return fSite.p->QueryInterface(riid, ppvSite);
208}
CComPtr< IDockingWindowSite > fSite
Definition: brandband.h:37
REFIID riid
Definition: atlbase.h:39

◆ GetSizeMax()

HRESULT STDMETHODCALLTYPE CBrandBand::GetSizeMax ( ULARGE_INTEGER pcbSize)
virtual

Implements IPersistStream.

Definition at line 293 of file brandband.cpp.

294{
295 return E_NOTIMPL;
296}

◆ GetTypeInfo()

HRESULT STDMETHODCALLTYPE CBrandBand::GetTypeInfo ( UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
virtual

Implements IDispatch.

Definition at line 356 of file brandband.cpp.

357{
358 return E_NOTIMPL;
359}

◆ GetTypeInfoCount()

HRESULT STDMETHODCALLTYPE CBrandBand::GetTypeInfoCount ( UINT pctinfo)
virtual

Implements IDispatch.

Definition at line 351 of file brandband.cpp.

352{
353 return E_NOTIMPL;
354}

◆ GetWindow()

HRESULT STDMETHODCALLTYPE CBrandBand::GetWindow ( HWND lphwnd)
virtual

Implements IOleWindow.

Definition at line 210 of file brandband.cpp.

211{
212 if (lphwnd == NULL)
213 return E_POINTER;
214 *lphwnd = m_hWnd;
215 return S_OK;
216}

◆ HasFocusIO()

HRESULT STDMETHODCALLTYPE CBrandBand::HasFocusIO ( )
virtual

Definition at line 253 of file brandband.cpp.

254{
255 if (GetFocus() == m_hWnd)
256 return S_OK;
257 return S_FALSE;
258}
#define S_FALSE
Definition: winerror.h:2357
HWND WINAPI GetFocus(void)
Definition: window.c:1894

◆ Invoke()

HRESULT STDMETHODCALLTYPE CBrandBand::Invoke ( DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
virtual

Implements IDispatch.

Definition at line 367 of file brandband.cpp.

369{
370 if (pDispParams == NULL)
371 return E_INVALIDARG;
372 switch (dispIdMember)
373 {
376 break;
379 break;
380 }
381 return E_INVALIDARG;
382}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define DISPID_DOWNLOADCOMPLETE
Definition: webchild.h:39
#define DISPID_DOWNLOADBEGIN
Definition: webchild.h:41

◆ IsDirty()

HRESULT STDMETHODCALLTYPE CBrandBand::IsDirty ( void  )
virtual

Implements IPersistStream.

Definition at line 278 of file brandband.cpp.

279{
280 return S_FALSE;
281}

◆ IsWindowOwner()

HRESULT STDMETHODCALLTYPE CBrandBand::IsWindowOwner ( HWND  hWnd)
virtual

Definition at line 304 of file brandband.cpp.

305{
306 if (hWnd == m_hWnd)
307 return S_OK;
308 return S_FALSE;
309}
HWND hWnd
Definition: settings.c:17

◆ Load()

HRESULT STDMETHODCALLTYPE CBrandBand::Load ( IStream pStm)
virtual

Implements IPersistStream.

Definition at line 283 of file brandband.cpp.

284{
285 return E_NOTIMPL;
286}

◆ OnEraseBkgnd()

LRESULT CBrandBand::OnEraseBkgnd ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 390 of file brandband.cpp.

391{
392 return 1;
393}

◆ OnPaint()

LRESULT CBrandBand::OnPaint ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 395 of file brandband.cpp.

396{
397 PAINTSTRUCT paintInfo;
398 HDC dc;
399 POINT destinationPoint;
400 HDC sourceDC;
401 HBITMAP oldBitmap;
402 RECT clientRect;
403 RECT tempRect;
404
405 dc = BeginPaint(&paintInfo);
406 GetClientRect(&clientRect);
407
408 destinationPoint.x = (clientRect.right - clientRect.left - fBitmapSize) / 2;
409 destinationPoint.y = (clientRect.bottom - clientRect.top - fBitmapSize) / 2;
410
411 ::SetBkColor(dc, RGB(255, 255, 255));
412
413 tempRect.left = 0;
414 tempRect.top = 0;
415 tempRect.right = clientRect.right;
416 tempRect.bottom = destinationPoint.y;
417 FillSolidRect(dc, &tempRect, RGB(255, 255, 255));
418
419 tempRect.left = 0;
420 tempRect.top = destinationPoint.y + fBitmapSize;
421 tempRect.right = clientRect.right;
422 tempRect.bottom = clientRect.bottom;
423 FillSolidRect(dc, &paintInfo.rcPaint, RGB(255, 255, 255));
424
425 tempRect.left = 0;
426 tempRect.top = destinationPoint.y;
427 tempRect.right = destinationPoint.x;
428 tempRect.bottom = destinationPoint.y + fBitmapSize;
429 FillSolidRect(dc, &paintInfo.rcPaint, RGB(255, 255, 255));
430
431 tempRect.left = destinationPoint.x + fBitmapSize;
432 tempRect.top = destinationPoint.y;
433 tempRect.right = clientRect.right;
434 tempRect.bottom = destinationPoint.y + fBitmapSize;
435 FillSolidRect(dc, &paintInfo.rcPaint, RGB(255, 255, 255));
436
437 sourceDC = CreateCompatibleDC(dc);
438 oldBitmap = reinterpret_cast<HBITMAP>(SelectObject(sourceDC, fImageBitmap));
439
440 BitBlt(dc, destinationPoint.x, destinationPoint.y, fBitmapSize, fBitmapSize, sourceDC, 0, fCurrentFrame * fBitmapSize, SRCCOPY);
441
442 SelectObject(sourceDC, oldBitmap);
443 DeleteDC(sourceDC);
444
445 EndPaint(&paintInfo);
446 return 0;
447}
static VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:49
#define RGB(r, g, b)
Definition: precomp.h:62
static const WCHAR dc[]
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
void FillSolidRect(HDC hDC, LPCRECT lpRect, COLORREF clr)
Definition: taskmgr.c:500
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define SRCCOPY
Definition: wingdi.h:333
BOOL WINAPI DeleteDC(_In_ HDC)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)

◆ OnSize()

LRESULT CBrandBand::OnSize ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 384 of file brandband.cpp.

385{
386 Invalidate(FALSE);
387 return 0;
388}

◆ OnTimer()

LRESULT CBrandBand::OnTimer ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 449 of file brandband.cpp.

450{
453 fCurrentFrame = 0;
454 Invalidate(FALSE);
455 return 0;
456}

◆ OnWinEvent()

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

Definition at line 298 of file brandband.cpp.

300{
301 return E_NOTIMPL;
302}

◆ QueryService()

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

Implements IServiceProvider.

Definition at line 338 of file brandband.cpp.

339{
340 CComPtr<IServiceProvider> serviceProvider;
341 HRESULT hResult;
342
343 if (IsEqualIID(guidService, SID_SBrandBand))
344 return this->QueryInterface(riid, ppvObject);
345 hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, &serviceProvider));
346 if (FAILED_UNEXPECTEDLY(hResult))
347 return hResult;
348 return serviceProvider->QueryService(guidService, riid, ppvObject);
349}
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define IID_PPV_ARG(Itype, ppType)

◆ QueryStatus()

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

Implements IOleCommandTarget.

Definition at line 311 of file brandband.cpp.

313{
314 return E_NOTIMPL;
315}

◆ ResizeBorderDW()

HRESULT STDMETHODCALLTYPE CBrandBand::ResizeBorderDW ( const RECT prcBorder,
IUnknown punkToolbarSite,
BOOL  fReserved 
)
virtual

Definition at line 235 of file brandband.cpp.

237{
238 return E_NOTIMPL;
239}

◆ Save()

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

Implements IPersistStream.

Definition at line 288 of file brandband.cpp.

289{
290 return E_NOTIMPL;
291}

◆ SelectImage()

void CBrandBand::SelectImage ( )

Definition at line 81 of file brandband.cpp.

82{
83 int screenDepth;
84 RECT clientRect;
85 int clientWidth;
86 int clientHeight;
87 int clientSize;
88 BITMAP bitmapInfo;
89 int resourceID;
90
91 screenDepth = SHGetCurColorRes();
92 GetClientRect(&clientRect);
93 clientWidth = clientRect.right - clientRect.left;
94 clientHeight = clientRect.bottom - clientRect.top;
95 clientSize = min(clientWidth, clientHeight);
96 if (screenDepth > 8)
97 resourceID = gTrueColorResourceBase;
98 else
99 resourceID = g256ColorResourceBase;
100 if (clientSize >= gLargeImageSize)
101 resourceID += 2;
102 else if (clientSize >= gMediumImageSize)
103 resourceID += 1;
104 fImageBitmap = LoadBitmap(_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(resourceID));
105 GetObjectW(fImageBitmap, sizeof(bitmapInfo), &bitmapInfo);
106 fBitmapSize = bitmapInfo.bmWidth;
107 fMaxFrameCount = bitmapInfo.bmHeight / fBitmapSize;
108}
static const int gMediumImageSize
Definition: brandband.cpp:47
static const int gTrueColorResourceBase
Definition: brandband.cpp:50
static const int gLargeImageSize
Definition: brandband.cpp:48
static const int g256ColorResourceBase
Definition: brandband.cpp:51
DWORD WINAPI SHGetCurColorRes(void)
Definition: ordinal.c:2019
#define min(a, b)
Definition: monoChain.cc:55
Definition: bl.h:1331
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define LoadBitmap
Definition: winuser.h:5801
#define MAKEINTRESOURCE
Definition: winuser.h:591

Referenced by SetSite().

◆ SetSite()

HRESULT STDMETHODCALLTYPE CBrandBand::SetSite ( IUnknown pUnkSite)
virtual

Implements IObjectWithSite.

Definition at line 141 of file brandband.cpp.

142{
143 CComPtr<IBrowserService> browserService;
144 CComPtr<IOleWindow> oleWindow;
145 CComPtr<IServiceProvider> serviceProvider;
146 CComPtr<IProfferService> profferService;
147 HWND parentWindow;
148 HWND hwnd;
149 HRESULT hResult;
150
151 fSite.Release();
152 if (pUnkSite == NULL)
153 {
154 hResult = AtlUnadvise(fSite, DIID_DWebBrowserEvents, fAdviseCookie);
155 // TODO: revoke brand band service
156 return S_OK;
157 }
158
159 // get window handle of parent
160 hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, &fSite));
161 if (FAILED_UNEXPECTEDLY(hResult))
162 return hResult;
163 parentWindow = NULL;
164 hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
165 if (SUCCEEDED(hResult))
166 hResult = oleWindow->GetWindow(&parentWindow);
167 if (!::IsWindow(parentWindow))
168 return E_FAIL;
169
170 // create worker window in parent window
171 hwnd = SHCreateWorkerWindowW(0, parentWindow, 0,
173 if (hwnd == NULL)
174 return E_FAIL;
176
177 // take advice to watch events
178 hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IServiceProvider, &serviceProvider));
179 if (SUCCEEDED(hResult))
180 {
181 hResult = serviceProvider->QueryService(
182 SID_SBrandBand, IID_PPV_ARG(IProfferService, &profferService));
183 if (SUCCEEDED(hResult))
184 hResult = profferService->ProfferService(SID_SBrandBand,
185 static_cast<IServiceProvider *>(this), &fProfferCookie);
186 hResult = serviceProvider->QueryService(SID_SShellBrowser,
187 IID_PPV_ARG(IBrowserService, &browserService));
188 if (SUCCEEDED(hResult))
189 hResult = AtlAdvise(browserService, static_cast<IDispatch *>(this), DIID_DWebBrowserEvents, &fAdviseCookie);
190 }
191
192 // ignore any hResult errors up to here - they are nonfatal
193 hResult = S_OK;
194 SelectImage();
195 return hResult;
196}
void Release()
Definition: atlcomcli.h:147
void SelectImage()
Definition: brandband.cpp:81
HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID *iid, DWORD *pdw)
Definition: atl.c:45
HRESULT WINAPI AtlUnadvise(IUnknown *pUnkCP, const IID *iid, DWORD dw)
Definition: atl.c:73
HWND WINAPI SHCreateWorkerWindowW(WNDPROC wndProc, HWND hWndParent, DWORD dwExStyle, DWORD dwStyle, HMENU hMenu, LONG_PTR wnd_extra)
Definition: ordinal.c:2921
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define SID_SShellBrowser
Definition: shlguid.h:128
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:542

◆ ShowDW()

HRESULT STDMETHODCALLTYPE CBrandBand::ShowDW ( BOOL  fShow)
virtual

Implements IDockingWindow.

Definition at line 241 of file brandband.cpp.

242{
243 if (m_hWnd)
244 {
245 if (fShow)
247 else
249 }
250 return S_OK;
251}
#define SW_HIDE
Definition: winuser.h:762
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SW_SHOW
Definition: winuser.h:769

Referenced by CloseDW().

◆ StartAnimation()

void CBrandBand::StartAnimation ( )

Definition at line 68 of file brandband.cpp.

69{
70 fCurrentFrame = 0;
71 SetTimer(5678, 30, NULL);
72}
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)

Referenced by Exec(), and Invoke().

◆ StopAnimation()

void CBrandBand::StopAnimation ( )

Definition at line 74 of file brandband.cpp.

75{
76 KillTimer(5678);
77 fCurrentFrame = 0;
78 Invalidate(FALSE);
79}
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

Referenced by Exec(), and Invoke().

◆ TranslateAcceleratorIO()

HRESULT STDMETHODCALLTYPE CBrandBand::TranslateAcceleratorIO ( LPMSG  lpMsg)
virtual

Definition at line 260 of file brandband.cpp.

261{
262 return E_NOTIMPL;
263}

◆ UIActivateIO()

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

Definition at line 265 of file brandband.cpp.

266{
267 return E_NOTIMPL;
268}

Member Data Documentation

◆ fAdviseCookie

DWORD CBrandBand::fAdviseCookie
private

Definition at line 43 of file brandband.h.

Referenced by CBrandBand(), and SetSite().

◆ fBitmapSize

int CBrandBand::fBitmapSize
private

Definition at line 42 of file brandband.h.

Referenced by CBrandBand(), OnPaint(), and SelectImage().

◆ fCurrentFrame

int CBrandBand::fCurrentFrame
private

Definition at line 39 of file brandband.h.

Referenced by CBrandBand(), OnPaint(), OnTimer(), StartAnimation(), and StopAnimation().

◆ fImageBitmap

HBITMAP CBrandBand::fImageBitmap
private

Definition at line 41 of file brandband.h.

Referenced by CBrandBand(), OnPaint(), SelectImage(), and ~CBrandBand().

◆ fMaxFrameCount

int CBrandBand::fMaxFrameCount
private

Definition at line 40 of file brandband.h.

Referenced by CBrandBand(), OnTimer(), and SelectImage().

◆ fProfferCookie

DWORD CBrandBand::fProfferCookie
private

Definition at line 38 of file brandband.h.

Referenced by CBrandBand(), and SetSite().

◆ fSite

CComPtr<IDockingWindowSite> CBrandBand::fSite
private

Definition at line 37 of file brandband.h.

Referenced by GetSite(), QueryService(), and SetSite().


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