ReactOS 0.4.17-dev-258-gb1f0478
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, IN BOOL bRefresh)
 
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 51 of file startmnu.cpp.

55{
56 HRESULT hr;
63 DWORD dwBandId = 0;
64
67 return NULL;
68
71 return NULL;
72
73 /* Set the menu site so we can handle messages */
74 hr = IUnknown_SetSite(pMp, pSms);
76 return NULL;
77
78 /* Initialize the menu object */
79 hr = pMp->QueryInterface(IID_PPV_ARG(IInitializeObject, &pIo));
80 if (SUCCEEDED(hr))
81 hr = pIo->Initialize();
82 else
83 hr = S_OK;
84
85 /* Everything is initialized now. Let's get the IMenuBand interface. */
87 return NULL;
88
89 hr = pMp->GetClient(&pUnk);
91 return NULL;
92
95 return NULL;
96
97 /* Finally we have the IBandSite interface, there's only one
98 band in it that apparently provides the IMenuBand interface */
99 hr = pBs->EnumBands(0, &dwBandId);
101 return NULL;
102
103 hr = pBs->GetBandObject(dwBandId, IID_PPV_ARG(IMenuBand, &pMb));
105 return NULL;
106
107 UpdateStartMenu(pMp, hbmBanner, bSmallIcons, FALSE);
108
109 *ppMenuBand = pMb.Detach();
110
111 return pMp.Detach();
112}
HRESULT CStartMenuSite_CreateInstance(IN OUT ITrayWindow *Tray, const IID &riid, PVOID *ppv)
HRESULT WINAPI _CStartMenu_CreateInstance(REFIID riid, void **ppv)
Definition: rshell.cpp:32
T * Detach()
Definition: atlcomcli.h:186
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
HRESULT WINAPI IUnknown_SetSite(IUnknown *obj, IUnknown *site)
Definition: ordinal.c:1411
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:32
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
unsigned long DWORD
Definition: ntddk_ex.h:95
nsresult QueryInterface(nsIIDRef riid, void **result)
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT UpdateStartMenu(IN OUT IMenuPopup *pMenuPopup, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons, IN BOOL bRefresh)
Definition: startmnu.cpp:24
#define IID_PPV_ARG(Itype, ppType)

Referenced by CTrayWindow::OnCreate(), and CTrayWindow::OnSettingChanged().

◆ UpdateStartMenu()

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

Definition at line 24 of file startmnu.cpp.

28{
30 HRESULT hRet;
31
32 hRet = pMenuPopup->QueryInterface(IID_PPV_ARG(IBanneredBar, &pbb));
33 if (SUCCEEDED(hRet))
34 {
35 hRet = pbb->SetBitmap(hbmBanner);
36
37 /* Update the icon size */
38 hRet = pbb->SetIconSize(bSmallIcons ? BMICON_SMALL : BMICON_LARGE);
39 }
40
41 if (bRefresh)
42 {
43 FIXME("Refresh the Start menu with communicating with SHELL32\n");
44 // TODO: TRAYCMD_RELOAD_STARTMENUCFG
45 }
46
47 return hRet;
48}
#define FIXME(fmt,...)
Definition: precomp.h:53
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
@ BMICON_SMALL
Definition: shlobj_undoc.h:168
@ BMICON_LARGE
Definition: shlobj_undoc.h:167

Referenced by CreateStartMenu(), and CTrayWindow::OnSettingChanged().