ReactOS  0.4.15-dev-449-g64abd9f
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 ()
 
- Public Member Functions inherited from IDockingWindow
HRESULT ResizeBorderDW ([in] LPCRECT prcBorder, [in] IUnknown *punkToolbarSite, [in] BOOL fReserved)
 
- 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 GetSite ([in] REFIID riid, [out, iid_is(riid)] PVOID *ppvSite)
 
- Public Member Functions inherited from IServiceProvider
HRESULT RemoteQueryService ([in] REFGUID guidService, [in] REFIID riid, [out, iid_is(riid)] IUnknown **ppvObject)
 
- Public Member Functions inherited from IDispatch
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 {
55  fProfferCookie = 0;
56  fCurrentFrame = 0;
57  fMaxFrameCount = 0;
59  fBitmapSize = 0;
60  fAdviseCookie = 0;
61 }
DWORD fProfferCookie
Definition: brandband.h:38
HBITMAP fImageBitmap
Definition: brandband.h:41
int fMaxFrameCount
Definition: brandband.h:40
smooth NULL
Definition: ftsmooth.c:416
DWORD fAdviseCookie
Definition: brandband.h:43
int fBitmapSize
Definition: brandband.h:42
int fCurrentFrame
Definition: brandband.h:39

◆ ~CBrandBand()

CBrandBand::~CBrandBand ( )

Definition at line 63 of file brandband.cpp.

64 {
66 }
HBITMAP fImageBitmap
Definition: brandband.h:41
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)

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())
228  DestroyWindow();
229 
230  m_hWnd = NULL;
231 
232  return S_OK;
233 }
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)
virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow)
Definition: brandband.cpp:241
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59

◆ 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  {
327  case BBID_STARTANIMATION:
328  StartAnimation();
329  return S_OK;
330  case BBID_STOPANIMATION:
331  StopAnimation();
332  return S_OK;
333  }
334  }
335  return E_FAIL;
336 }
#define E_FAIL
Definition: ddrawi.h:102
void StopAnimation()
Definition: brandband.cpp:74
#define BBID_STARTANIMATION
Definition: undocshell.h:661
void StartAnimation()
Definition: brandband.cpp:68
#define BBID_STOPANIMATION
Definition: undocshell.h:662
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ 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 }
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59

◆ 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 }
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
#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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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: precomp.h:44
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
#define E_POINTER
Definition: winerror.h:2365

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

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

◆ GetTypeInfoCount()

HRESULT STDMETHODCALLTYPE CBrandBand::GetTypeInfoCount ( UINT pctinfo)
virtual

Implements IDispatch.

Definition at line 351 of file brandband.cpp.

352 {
353  return E_NOTIMPL;
354 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ 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
#define S_OK
Definition: intsafe.h:59
HWND WINAPI GetFocus(void)
Definition: window.c:1909

◆ 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  {
375  StopAnimation();
376  break;
378  StartAnimation();
379  break;
380  }
381  return E_INVALIDARG;
382 }
#define DISPID_DOWNLOADCOMPLETE
Definition: webchild.h:39
void StopAnimation()
Definition: brandband.cpp:74
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
void StartAnimation()
Definition: brandband.cpp:68
#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 }
#define S_FALSE
Definition: winerror.h:2357

◆ 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
#define S_FALSE
Definition: winerror.h:2357
#define S_OK
Definition: intsafe.h:59

◆ Load()

HRESULT STDMETHODCALLTYPE CBrandBand::Load ( IStream pStm)
virtual

Implements IPersistStream.

Definition at line 283 of file brandband.cpp.

284 {
285  return E_NOTIMPL;
286 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
long y
Definition: polytest.cpp:48
#define RGB(r, g, b)
Definition: precomp.h:62
long x
Definition: polytest.cpp:48
static HDC
Definition: imagelist.c:92
HBITMAP fImageBitmap
Definition: brandband.h:41
LONG top
Definition: windef.h:307
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
LONG left
Definition: windef.h:306
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
LONG right
Definition: windef.h:308
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:975
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
static VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_ PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:49
int fBitmapSize
Definition: brandband.h:42
int fCurrentFrame
Definition: brandband.h:39
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI DeleteDC(_In_ HDC)
LONG bottom
Definition: windef.h:309
static const WCHAR dc[]
static HBITMAP
Definition: button.c:44
#define SRCCOPY
Definition: wingdi.h:332
void FillSolidRect(HDC dc, const RECT *bounds)
Definition: brandband.cpp:35

◆ 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 {
451  fCurrentFrame++;
453  fCurrentFrame = 0;
454  Invalidate(FALSE);
455  return 0;
456 }
int fMaxFrameCount
Definition: brandband.h:40
int fCurrentFrame
Definition: brandband.h:39

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

◆ 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 }
CComPtr< IDockingWindowSite > fSite
Definition: brandband.h:37
REFIID riid
Definition: precomp.h:44
#define IID_PPV_ARG(Itype, ppType)
LONG HRESULT
Definition: typedefs.h:78
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
REFIID LPVOID * ppvObject
Definition: precomp.h:44
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

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

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

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

◆ 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 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
DWORD WINAPI SHGetCurColorRes(void)
Definition: ordinal.c:2016
static const int gTrueColorResourceBase
Definition: brandband.cpp:50
static const int g256ColorResourceBase
Definition: brandband.cpp:51
HBITMAP fImageBitmap
Definition: brandband.h:41
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
int fMaxFrameCount
Definition: brandband.h:40
static const int gLargeImageSize
Definition: brandband.cpp:48
static const int gMediumImageSize
Definition: brandband.cpp:47
#define LoadBitmap
Definition: winuser.h:5786
int fBitmapSize
Definition: brandband.h:42
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
Definition: bl.h:1331
#define min(a, b)
Definition: monoChain.cc:55
LONG bottom
Definition: windef.h:309

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 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
CComPtr< IDockingWindowSite > fSite
Definition: brandband.h:37
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
DWORD fProfferCookie
Definition: brandband.h:38
BOOL WINAPI IsWindow(_In_opt_ HWND)
HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID *iid, DWORD *pdw)
Definition: atl.c:45
void SelectImage()
Definition: brandband.cpp:81
#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 SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:517
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI AtlUnadvise(IUnknown *pUnkCP, const IID *iid, DWORD dw)
Definition: atl.c:73
LONG HRESULT
Definition: typedefs.h:78
DWORD fAdviseCookie
Definition: brandband.h:43
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define S_OK
Definition: intsafe.h:59
void Release()
Definition: atlcomcli.h:140
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
HWND WINAPI SHCreateWorkerWindowW(WNDPROC wndProc, HWND hWndParent, DWORD dwExStyle, DWORD dwStyle, HMENU hMenu, LONG_PTR wnd_extra)
Definition: ordinal.c:2918
#define SID_SShellBrowser
Definition: shlguid.h:125
#define WS_VISIBLE
Definition: pedump.c:620
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ 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
#define S_OK
Definition: intsafe.h:59

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 }
smooth NULL
Definition: ftsmooth.c:416
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
int fCurrentFrame
Definition: brandband.h:39

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 }
int fCurrentFrame
Definition: brandband.h:39
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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ UIActivateIO()

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

Definition at line 265 of file brandband.cpp.

266 {
267  return E_NOTIMPL;
268 }
#define E_NOTIMPL
Definition: ddrawi.h:99

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: