ReactOS  0.4.13-dev-464-g6b95727
startmnu.cpp File Reference
#include "precomp.h"
Include dependency graph for startmnu.cpp:

Go to the source code of this file.

Functions

HRESULT UpdateStartMenu (IN OUT IMenuPopup *pMenuPopup, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons)
 
IMenuPopupCreateStartMenu (IN ITrayWindow *Tray, OUT IMenuBand **ppMenuBand, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons)
 

Function Documentation

◆ CreateStartMenu()

IMenuPopup* CreateStartMenu ( IN ITrayWindow *  Tray,
OUT IMenuBand **  ppMenuBand,
IN HBITMAP hbmBanner  OPTIONAL,
IN BOOL  bSmallIcons 
)

Definition at line 44 of file startmnu.cpp.

48 {
49  HRESULT hr;
51  CComPtr<IUnknown> pSms;
56  DWORD dwBandId = 0;
57 
60  return NULL;
61 
64  return NULL;
65 
66  /* Set the menu site so we can handle messages */
67  hr = IUnknown_SetSite(pMp, pSms);
69  return NULL;
70 
71  /* Initialize the menu object */
72  hr = pMp->QueryInterface(IID_PPV_ARG(IInitializeObject, &pIo));
73  if (SUCCEEDED(hr))
74  hr = pIo->Initialize();
75  else
76  hr = S_OK;
77 
78  /* Everything is initialized now. Let's get the IMenuBand interface. */
80  return NULL;
81 
82  hr = pMp->GetClient(&pUnk);
84  return NULL;
85 
88  return NULL;
89 
90  /* Finally we have the IBandSite interface, there's only one
91  band in it that apparently provides the IMenuBand interface */
92  hr = pBs->EnumBands(0, &dwBandId);
94  return NULL;
95 
96  hr = pBs->GetBandObject(dwBandId, IID_PPV_ARG(IMenuBand, &pMb));
98  return NULL;
99 
100  UpdateStartMenu(pMp,
101  hbmBanner,
102  bSmallIcons);
103 
104  *ppMenuBand = pMb.Detach();
105 
106  return pMp.Detach();
107 }
HRESULT WINAPI _CStartMenu_CreateInstance(REFIID riid, void **ppv)
Definition: rshell.cpp:32
HRESULT hr
Definition: shlfolder.c:183
HRESULT UpdateStartMenu(IN OUT IMenuPopup *pMenuPopup, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons)
Definition: startmnu.cpp:24
#define IID_PPV_ARG(Itype, ppType)
HRESULT WINAPI IUnknown_SetSite(IUnknown *obj, IUnknown *site)
Definition: ordinal.c:1358
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT CStartMenuSite_CreateInstance(IN OUT ITrayWindow *Tray, const IID &riid, PVOID *ppv)
#define S_OK
Definition: intsafe.h:59
T * Detach()
Definition: atlcomcli.h:156
nsresult QueryInterface(nsIIDRef riid, void **result)
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by CTrayWindow::OnCreate().

◆ UpdateStartMenu()

HRESULT UpdateStartMenu ( IN OUT IMenuPopup pMenuPopup,
IN HBITMAP hbmBanner  OPTIONAL,
IN BOOL  bSmallIcons 
)

Definition at line 24 of file startmnu.cpp.

27 {
29  HRESULT hRet;
30 
31  hRet = pMenuPopup->QueryInterface(IID_PPV_ARG(IBanneredBar, &pbb));
32  if (SUCCEEDED(hRet))
33  {
34  hRet = pbb->SetBitmap(hbmBanner);
35 
36  /* Update the icon size */
37  hRet = pbb->SetIconSize(bSmallIcons ? BMICON_SMALL : BMICON_LARGE);
38  }
39 
40  return hRet;
41 }
#define IID_PPV_ARG(Itype, ppType)
LONG HRESULT
Definition: typedefs.h:77
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by CreateStartMenu().