ReactOS  0.4.13-dev-1089-g05f0b08
CStartMenu.cpp
Go to the documentation of this file.
1 /*
2  * ReactOS Explorer
3  *
4  * Copyright 2014 Giannis Adamopoulos
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 #include "shellmenu.h"
21 
22 #include "CMergedFolder.h"
23 
24 WINE_DEFAULT_DEBUG_CHANNEL(CStartMenu);
25 
26 //#define TEST_TRACKPOPUPMENU_SUBMENUS
27 
28 
29 /* NOTE: The following constants *MUST NOT* be changed because
30  they're hardcoded and need to be the exact values
31  in order to get the start menu to work! */
32 #define IDM_RUN 401
33 #define IDM_LOGOFF 402
34 #define IDM_UNDOCKCOMPUTER 410
35 #define IDM_TASKBARANDSTARTMENU 413
36 #define IDM_LASTSTARTMENU_SEPARATOR 450
37 #define IDM_DOCUMENTS 501
38 #define IDM_HELPANDSUPPORT 503
39 #define IDM_PROGRAMS 504
40 #define IDM_CONTROLPANEL 505
41 #define IDM_SHUTDOWN 506
42 #define IDM_FAVORITES 507
43 #define IDM_SETTINGS 508
44 #define IDM_PRINTERSANDFAXES 510
45 #define IDM_SEARCH 520
46 #define IDM_SYNCHRONIZE 553
47 #define IDM_NETWORKCONNECTIONS 557
48 #define IDM_DISCONNECT 5000
49 #define IDM_SECURITY 5001
50 
51 /*
52  * TODO:
53  * 1. append the start menu contents from all users
54  * 2. implement the context menu for start menu entries (programs, control panel, network connetions, printers)
55  * 3. filter out programs folder from the shell folder part of the start menu
56  * 4. showing the programs start menu is SLOW compared to windows. this needs some investigation
57  */
58 
60  public CComObjectRootEx<CComMultiThreadModelNoCS>,
61  public IShellMenuCallback
62 {
63 private:
64 
66  CComPtr<IShellMenu> m_pShellMenu;
67  CComPtr<IBandSite> m_pBandSite;
68  CComPtr<IDeskBar> m_pDeskBar;
69  CComPtr<ITrayPriv> m_pTrayPriv;
70  CComPtr<IShellFolder> m_psfPrograms;
71 
73 
75  {
76  HMENU hmenu;
77  HRESULT hr;
78 
79  if (m_pTrayPriv.p)
80  return S_OK;
81 
84  return hr;
85 
88  return hr;
89 
90  hr = m_pTrayPriv->AppendMenuW(&hmenu);
92  return hr;
93 
94  hr = m_pShellMenu->SetMenu(hmenu, NULL, SMSET_BOTTOM);
96  return hr;
97 
98  return hr;
99  }
100 
102  {
103  int iconIndex = 0;
104 
105  switch (psmd->uId)
106  {
107  // Smaller "24x24" icons used for the start menu
108  // The bitmaps are still 32x32, but the image is centered
109  case IDM_FAVORITES: iconIndex = -322; break;
110  case IDM_SEARCH: iconIndex = -323; break;
111  case IDM_HELPANDSUPPORT: iconIndex = -324; break;
112  case IDM_LOGOFF: iconIndex = -325; break;
113  case IDM_PROGRAMS: iconIndex = -326; break;
114  case IDM_DOCUMENTS: iconIndex = -327; break;
115  case IDM_RUN: iconIndex = -328; break;
116  case IDM_SHUTDOWN: iconIndex = -329; break;
117  case IDM_SETTINGS: iconIndex = -330; break;
118 
119  case IDM_CONTROLPANEL: iconIndex = -22; break;
120  case IDM_NETWORKCONNECTIONS: iconIndex = -257; break;
121  case IDM_PRINTERSANDFAXES: iconIndex = -138; break;
122  case IDM_TASKBARANDSTARTMENU: iconIndex = -40; break;
123  //case IDM_SECURITY: iconIndex = -21; break;
124  //case IDM_SYNCHRONIZE: iconIndex = -21; break;
125  //case IDM_DISCONNECT: iconIndex = -21; break;
126  //case IDM_UNDOCKCOMPUTER: iconIndex = -21; break;
127  default:
128  return S_FALSE;
129  }
130 
131  if (iconIndex)
132  {
133  if ((psminfo->dwMask & SMIM_TYPE) != 0)
134  psminfo->dwType = SMIT_STRING;
135  if ((psminfo->dwMask & SMIM_ICON) != 0)
136  psminfo->iIcon = Shell_GetCachedImageIndex(L"shell32.dll", iconIndex, FALSE);
137  if ((psminfo->dwMask & SMIM_FLAGS) != 0)
138  psminfo->dwFlags |= SMIF_ICON;
139 #ifdef TEST_TRACKPOPUPMENU_SUBMENUS
140  if ((psminfo->dwMask & SMIM_FLAGS) != 0)
141  psminfo->dwFlags |= SMIF_TRACKPOPUP;
142 #endif
143  }
144  else
145  {
146  if ((psminfo->dwMask & SMIM_TYPE) != 0)
147  psminfo->dwType = SMIT_SEPARATOR;
148  }
149  return S_OK;
150  }
151 
152  HRESULT OnGetSubMenu(LPSMDATA psmd, REFIID iid, void ** pv)
153  {
154  HRESULT hr;
155  int csidl = 0;
156  IShellMenu *pShellMenu;
157 
159  if (FAILED_UNEXPECTEDLY(hr))
160  return hr;
161 
162  hr = pShellMenu->Initialize(this, 0, ANCESTORDEFAULT, SMINIT_VERTICAL);
163  if (FAILED_UNEXPECTEDLY(hr))
164  return hr;
165 
166  switch (psmd->uId)
167  {
168  case IDM_PROGRAMS: csidl = CSIDL_PROGRAMS; break;
169  case IDM_FAVORITES: csidl = CSIDL_FAVORITES; break;
170  case IDM_DOCUMENTS: csidl = CSIDL_RECENT; break;
171  }
172 
173  if (csidl)
174  {
175  IShellFolder *psfStartMenu;
176 
177  if (csidl == CSIDL_PROGRAMS && m_psfPrograms)
178  {
179  psfStartMenu = m_psfPrograms;
180  }
181  else
182  {
183  LPITEMIDLIST pidlStartMenu;
184  IShellFolder *psfDestop;
185  hr = SHGetFolderLocation(NULL, csidl, 0, 0, &pidlStartMenu);
186  if (FAILED_UNEXPECTEDLY(hr))
187  return hr;
188 
189  hr = SHGetDesktopFolder(&psfDestop);
190  if (FAILED_UNEXPECTEDLY(hr))
191  return hr;
192 
193  hr = psfDestop->BindToObject(pidlStartMenu, NULL, IID_PPV_ARG(IShellFolder, &psfStartMenu));
194  if (FAILED_UNEXPECTEDLY(hr))
195  return hr;
196  }
197 
198  hr = pShellMenu->SetShellFolder(psfStartMenu, NULL, NULL, 0);
199  if (FAILED_UNEXPECTEDLY(hr))
200  return hr;
201 
202  }
203  else
204  {
205  MENUITEMINFO mii;
206  mii.cbSize = sizeof(mii);
207  mii.fMask = MIIM_SUBMENU;
208  if (GetMenuItemInfoW(psmd->hmenu, psmd->uId, FALSE, &mii))
209  {
210  hr = pShellMenu->SetMenu(mii.hSubMenu, NULL, SMSET_BOTTOM);
211  if (FAILED_UNEXPECTEDLY(hr))
212  return hr;
213  }
214  }
215  return pShellMenu->QueryInterface(iid, pv);
216  }
217 
218  HRESULT OnGetContextMenu(LPSMDATA psmd, REFIID iid, void ** pv)
219  {
220  if (psmd->uId == IDM_PROGRAMS ||
221  psmd->uId == IDM_CONTROLPANEL ||
222  psmd->uId == IDM_NETWORKCONNECTIONS ||
223  psmd->uId == IDM_PRINTERSANDFAXES)
224  {
225  //UNIMPLEMENTED
226  }
227 
228  return S_FALSE;
229  }
230 
231  HRESULT OnGetObject(LPSMDATA psmd, REFIID iid, void ** pv)
232  {
233  if (IsEqualIID(iid, IID_IShellMenu))
234  return OnGetSubMenu(psmd, iid, pv);
235  else if (IsEqualIID(iid, IID_IContextMenu))
236  return OnGetContextMenu(psmd, iid, pv);
237 
238  return S_FALSE;
239  }
240 
242  {
243  // HACK: Because our ShellExecute can't handle CLSID components in paths, we can't launch the paths using the "open" verb.
244  // FIXME: Change this back to using the path as the filename and the "open" verb, once ShellExecute can handle CLSID path components.
245 
246  if (psmd->uId == IDM_CONTROLPANEL)
247  ShellExecuteW(NULL, NULL, L"explorer.exe", L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}", NULL, SW_SHOWNORMAL);
248  else if (psmd->uId == IDM_NETWORKCONNECTIONS)
249  ShellExecuteW(NULL, NULL, L"explorer.exe", L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}", NULL, SW_SHOWNORMAL);
250  else if (psmd->uId == IDM_PRINTERSANDFAXES)
251  ShellExecuteW(NULL, NULL, L"explorer.exe", L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}", NULL, SW_SHOWNORMAL);
252  else
254 
255  return S_OK;
256  }
257 
258 public:
259 
263  COM_INTERFACE_ENTRY_IID(IID_IShellMenuCallback, IShellMenuCallback)
264  END_COM_MAP()
265 
267  IShellMenu* pShellMenu,
268  IBandSite* pBandSite,
269  IDeskBar* pDeskBar)
270  {
271  m_pShellMenu = pShellMenu;
272  m_pBandSite = pBandSite;
273  m_pDeskBar = pDeskBar;
274  }
275 
277  {
278  }
279 
281  {
282  m_psfPrograms = psf;
283  m_pidlPrograms = pidl;
284  return S_OK;
285  }
286 
288  LPSMDATA psmd,
289  UINT uMsg,
290  WPARAM wParam,
291  LPARAM lParam)
292  {
293  switch (uMsg)
294  {
295  case SMC_INITMENU:
296  return OnInitMenu();
297  case SMC_GETINFO:
298  return OnGetInfo(psmd, reinterpret_cast<SMINFO*>(lParam));
299  case SMC_GETOBJECT:
300  return OnGetObject(psmd, *reinterpret_cast<IID *>(wParam), reinterpret_cast<void **>(lParam));
301  case SMC_EXEC:
302  return OnExec(psmd);
303  case SMC_SFEXEC:
304  m_pTrayPriv->Execute(psmd->psf, psmd->pidlItem);
305  break;
306  case 0x10000000: // _FilterPIDL from CMenuSFToolbar
307  if (psmd->psf->CompareIDs(0, psmd->pidlItem, m_pidlPrograms) == 0)
308  return S_OK;
309  return S_FALSE;
310  }
311 
312  return S_FALSE;
313  }
314 };
315 
317 {
318  HRESULT hr;
319  CComPtr<IShellFolder> psfDesktop;
320 
321  *ppsfResult = NULL;
322 
323  hr = SHGetDesktopFolder(&psfDesktop);
324  if (FAILED(hr))
325  return hr;
326 
327  hr = psfDesktop->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder, ppsfResult));
328 
329  return hr;
330 }
331 
332 static HRESULT GetMergedFolder(int folder1, int folder2, IShellFolder ** ppsfStartMenu)
333 {
334  HRESULT hr;
335  LPITEMIDLIST pidlUserStartMenu;
336  LPITEMIDLIST pidlCommonStartMenu;
337  CComPtr<IShellFolder> psfUserStartMenu;
338  CComPtr<IShellFolder> psfCommonStartMenu;
339  CComPtr<IAugmentedShellFolder> pasf;
340 
341  *ppsfStartMenu = NULL;
342 
343  hr = SHGetSpecialFolderLocation(NULL, folder1, &pidlUserStartMenu);
344  if (FAILED(hr))
345  {
346  WARN("Failed to get the USER start menu folder. Trying to run with just the COMMON one.\n");
347 
348  hr = SHGetSpecialFolderLocation(NULL, folder2, &pidlCommonStartMenu);
349  if (FAILED_UNEXPECTEDLY(hr))
350  return hr;
351 
352  TRACE("COMMON start menu obtained.\n");
353  hr = BindToDesktop(pidlCommonStartMenu, ppsfStartMenu);
354  ILFree(pidlCommonStartMenu);
355  return hr;
356  }
357 #if MERGE_FOLDERS
358  hr = SHGetSpecialFolderLocation(NULL, folder2, &pidlCommonStartMenu);
359  if (FAILED_UNEXPECTEDLY(hr))
360 #else
361  else
362 #endif
363  {
364  WARN("Failed to get the COMMON start menu folder. Will use only the USER contents.\n");
365  hr = BindToDesktop(pidlUserStartMenu, ppsfStartMenu);
366  ILFree(pidlUserStartMenu);
367  return hr;
368  }
369 
370  TRACE("Both COMMON and USER statr menu folders obtained, merging them...\n");
371 
372  hr = BindToDesktop(pidlUserStartMenu, &psfUserStartMenu);
373  if (FAILED_UNEXPECTEDLY(hr))
374  return hr;
375 
376  hr = BindToDesktop(pidlCommonStartMenu, &psfCommonStartMenu);
377  if (FAILED_UNEXPECTEDLY(hr))
378  return hr;
379 
380  hr = CMergedFolder_CreateInstance(IID_PPV_ARG(IAugmentedShellFolder, &pasf));
381  if (FAILED_UNEXPECTEDLY(hr))
382  {
383  *ppsfStartMenu = psfUserStartMenu.Detach();
384  ILFree(pidlCommonStartMenu);
385  ILFree(pidlUserStartMenu);
386  return hr;
387  }
388 
389  hr = pasf->AddNameSpace(NULL, psfUserStartMenu, pidlUserStartMenu, 0xFF00);
390  if (FAILED_UNEXPECTEDLY(hr))
391  return hr;
392 
393  hr = pasf->AddNameSpace(NULL, psfCommonStartMenu, pidlCommonStartMenu, 0);
394  if (FAILED_UNEXPECTEDLY(hr))
395  return hr;
396 
397  hr = pasf->QueryInterface(IID_PPV_ARG(IShellFolder, ppsfStartMenu));
398  pasf.Release();
399 
400  ILFree(pidlCommonStartMenu);
401  ILFree(pidlUserStartMenu);
402 
403  return hr;
404 }
405 
406 static HRESULT GetStartMenuFolder(IShellFolder ** ppsfStartMenu)
407 {
409 }
410 
411 static HRESULT GetProgramsFolder(IShellFolder ** ppsfStartMenu)
412 {
413  return GetMergedFolder(CSIDL_PROGRAMS, CSIDL_COMMON_PROGRAMS, ppsfStartMenu);
414 }
415 
416 extern "C"
419 {
420  CComPtr<IShellMenu> pShellMenu;
421  CComPtr<IBandSite> pBandSite;
422  CComPtr<IDeskBar> pDeskBar;
423 
424  HRESULT hr;
425  IShellFolder * psf;
426 
427  LPITEMIDLIST pidlProgramsAbsolute;
428  LPITEMIDLIST pidlPrograms;
429  CComPtr<IShellFolder> psfPrograms;
430 
432  if (FAILED_UNEXPECTEDLY(hr))
433  return hr;
434 
436  if (FAILED_UNEXPECTEDLY(hr))
437  return hr;
438 
440  if (FAILED_UNEXPECTEDLY(hr))
441  return hr;
442 
443  CComObject<CShellMenuCallback> *pCallback;
444  hr = CComObject<CShellMenuCallback>::CreateInstance(&pCallback);
445  if (FAILED_UNEXPECTEDLY(hr))
446  return hr;
447 
448  pCallback->AddRef(); // CreateInstance returns object with 0 ref count */
449  pCallback->Initialize(pShellMenu, pBandSite, pDeskBar);
450 
451  pShellMenu->Initialize(pCallback, (UINT) -1, 0, SMINIT_TOPLEVEL | SMINIT_VERTICAL);
452  if (FAILED_UNEXPECTEDLY(hr))
453  return hr;
454 
455  hr = GetStartMenuFolder(&psf);
456  if (FAILED_UNEXPECTEDLY(hr))
457  return hr;
458 
459  /* psf is a merged folder, so now we want to get the pidl of the programs item from the merged folder */
460  {
461  hr = SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAMS, &pidlProgramsAbsolute);
462  if (FAILED_UNEXPECTEDLY(hr))
463  {
464  WARN("USER Programs folder not found.");
465  hr = SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_PROGRAMS, &pidlProgramsAbsolute);
466  if (FAILED_UNEXPECTEDLY(hr))
467  return hr;
468  }
469 
470  LPCITEMIDLIST pcidlPrograms;
471  CComPtr<IShellFolder> psfParent;
472  STRRET str;
473  TCHAR szDisplayName[MAX_PATH];
474 
475  hr = SHBindToParent(pidlProgramsAbsolute, IID_PPV_ARG(IShellFolder, &psfParent), &pcidlPrograms);
476  if (FAILED_UNEXPECTEDLY(hr))
477  return hr;
478 
479  hr = psfParent->GetDisplayNameOf(pcidlPrograms, SHGDN_FORPARSING | SHGDN_INFOLDER, &str);
480  if (FAILED_UNEXPECTEDLY(hr))
481  return hr;
482 
483  StrRetToBuf(&str, pcidlPrograms, szDisplayName, _countof(szDisplayName));
484  ILFree(pidlProgramsAbsolute);
485 
486  /* We got the display name from the fs folder and we parse it with the merged folder here */
487  hr = psf->ParseDisplayName(NULL, NULL, szDisplayName, NULL, &pidlPrograms, NULL);
488  if (FAILED_UNEXPECTEDLY(hr))
489  return hr;
490  }
491 
492  hr = GetProgramsFolder(&psfPrograms);
493  if (FAILED_UNEXPECTEDLY(hr))
494  return hr;
495 
496  hr = pCallback->_SetProgramsFolder(psfPrograms, pidlPrograms);
497  if (FAILED_UNEXPECTEDLY(hr))
498  return hr;
499 
500  hr = pShellMenu->SetShellFolder(psf, NULL, NULL, 0);
501  if (FAILED_UNEXPECTEDLY(hr))
502  return hr;
503 
504  hr = pDeskBar->SetClient(pBandSite);
505  if (FAILED_UNEXPECTEDLY(hr))
506  return hr;
507 
508  hr = pBandSite->AddBand(pShellMenu);
509  if (FAILED_UNEXPECTEDLY(hr))
510  return hr;
511 
512  return pDeskBar->QueryInterface(riid, ppv);
513 }
#define IDM_CONTROLPANEL
Definition: CStartMenu.cpp:40
#define IDM_SHUTDOWN
Definition: CStartMenu.cpp:41
HRESULT STDMETHODCALLTYPE CallbackSM(LPSMDATA psmd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CStartMenu.cpp:287
#define REFIID
Definition: guiddef.h:118
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
#define IDM_SEARCH
Definition: CStartMenu.cpp:45
LPITEMIDLIST pidlItem
Definition: shobjidl.idl:2624
HRESULT WINAPI IUnknown_GetSite(LPUNKNOWN lpUnknown, REFIID iid, PVOID *lppSite)
Definition: ordinal.c:2547
void Initialize(IShellMenu *pShellMenu, IBandSite *pBandSite, IDeskBar *pDeskBar)
Definition: CStartMenu.cpp:266
HRESULT hr
Definition: shlfolder.c:183
static HMENU hmenu
Definition: win.c:66
HRESULT ParseDisplayName([in] HWND hwndOwner, [in] LPBC pbcReserved, [in, string] LPOLESTR lpszDisplayName, [out] ULONG *pchEaten, [out] PIDLIST_RELATIVE *ppidl, [in, out, unique] ULONG *pdwAttributes)
REFIID riid
Definition: precomp.h:44
static HRESULT GetStartMenuFolder(IShellFolder **ppsfStartMenu)
Definition: CStartMenu.cpp:406
#define _countof(array)
Definition: fontsub.cpp:30
#define WARN(fmt,...)
Definition: debug.h:111
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
CComPtr< IBandSite > m_pBandSite
Definition: CStartMenu.cpp:67
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define IDM_TASKBARANDSTARTMENU
Definition: CStartMenu.cpp:35
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:611
UINT_PTR WPARAM
Definition: windef.h:207
#define CMenuDeskBar_CreateInstance
Definition: shellmenu.h:75
#define IID_PPV_ARG(Itype, ppType)
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1283
HRESULT _SetProgramsFolder(IShellFolder *psf, LPITEMIDLIST pidl)
Definition: CStartMenu.cpp:280
WPARAM wParam
Definition: combotst.c:138
#define CSIDL_COMMON_PROGRAMS
Definition: shlobj.h:2025
#define CSIDL_RECENT
Definition: shlobj.h:2011
HRESULT CompareIDs([in] LPARAM lParam, [in] PCUIDLIST_RELATIVE pidl1, [in] PCUIDLIST_RELATIVE pidl2)
HRESULT SetShellFolder([in] IShellFolder *psf, [in] LPCITEMIDLIST pidlFolder, [in] HKEY hKey, [in] DWORD dwFlags)
#define IDM_RUN
Definition: CStartMenu.cpp:32
#define MIIM_SUBMENU
Definition: winuser.h:718
HRESULT WINAPI RSHELL_CStartMenu_CreateInstance(REFIID riid, void **ppv)
Definition: CStartMenu.cpp:418
static HRESULT GetProgramsFolder(IShellFolder **ppsfStartMenu)
Definition: CStartMenu.cpp:411
#define IDM_SETTINGS
Definition: CStartMenu.cpp:43
#define CSIDL_FAVORITES
Definition: shlobj.h:2009
HRESULT OnGetContextMenu(LPSMDATA psmd, REFIID iid, void **pv)
Definition: CStartMenu.cpp:218
#define StrRetToBuf
Definition: shlwapi.h:1769
#define S_FALSE
Definition: winerror.h:2357
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define CMenuSite_CreateInstance
Definition: shellmenu.h:87
CComPtr< IShellFolder > m_psfPrograms
Definition: CStartMenu.cpp:70
LONG_PTR LPARAM
Definition: windef.h:208
#define CSIDL_COMMON_STARTMENU
Definition: shlobj.h:2024
HRESULT BindToObject([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
#define SMC_EXEC
Definition: undocshell.h:611
#define CMergedFolder_CreateInstance
Definition: shellmenu.h:93
HRESULT OnGetSubMenu(LPSMDATA psmd, REFIID iid, void **pv)
Definition: CStartMenu.cpp:152
IShellFolder * psf
Definition: shobjidl.idl:2625
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
char TCHAR
Definition: xmlstorage.h:189
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
#define TRACE(s)
Definition: solgame.cpp:4
#define IDM_DOCUMENTS
Definition: CStartMenu.cpp:37
HRESULT SetMenu([in] HMENU hmenu, [in] HWND hwnd, [in] DWORD dwFlags)
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define IDM_PROGRAMS
Definition: CStartMenu.cpp:39
EXTERN_C INT WINAPI Shell_GetCachedImageIndex(LPCWSTR szPath, INT nIndex, UINT bSimulateDoc)
Definition: iconcache.cpp:861
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:2687
#define IDM_NETWORKCONNECTIONS
Definition: CStartMenu.cpp:47
LONG HRESULT
Definition: typedefs.h:77
#define IDM_FAVORITES
Definition: CStartMenu.cpp:42
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define MAX_PATH
Definition: compat.h:26
#define WINAPI
Definition: msvc.h:8
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
CComPtr< ITrayPriv > m_pTrayPriv
Definition: CStartMenu.cpp:69
HRESULT Initialize([in] IShellMenuCallback *psmc, [in] UINT uId, [in] UINT uIdAncestor, [in] DWORD dwFlags)
HRESULT OnExec(LPSMDATA psmd)
Definition: CStartMenu.cpp:241
CComPtr< IShellMenu > m_pShellMenu
Definition: CStartMenu.cpp:66
static const WCHAR L[]
Definition: oid.c:1250
HRESULT OnInitMenu()
Definition: CStartMenu.cpp:74
#define WM_COMMAND
Definition: winuser.h:1722
CComPtr< IDeskBar > m_pDeskBar
Definition: CStartMenu.cpp:68
#define IDM_PRINTERSANDFAXES
Definition: CStartMenu.cpp:44
HRESULT BindToDesktop(LPCITEMIDLIST pidl, IShellFolder **ppsfResult)
Definition: CStartMenu.cpp:316
#define S_OK
Definition: intsafe.h:59
#define SW_SHOWNORMAL
Definition: winuser.h:764
HRESULT OnGetObject(LPSMDATA psmd, REFIID iid, void **pv)
Definition: CStartMenu.cpp:231
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1323
#define CMenuBand_CreateInstance
Definition: shellmenu.h:81
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
#define IDM_LOGOFF
Definition: CStartMenu.cpp:33
static HRESULT GetMergedFolder(int folder1, int folder2, IShellFolder **ppsfStartMenu)
Definition: CStartMenu.cpp:332
unsigned int UINT
Definition: ndis.h:50
#define IDM_HELPANDSUPPORT
Definition: CStartMenu.cpp:38
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CSIDL_STARTMENU
Definition: shlobj.h:2014
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2208
LPITEMIDLIST m_pidlPrograms
Definition: CStartMenu.cpp:72
HRESULT WINAPI SHGetFolderLocation(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl)
Definition: shellpath.c:2598
#define END_COM_MAP()
Definition: atlcom.h:552
WINE_DEFAULT_DEBUG_CHANNEL(CStartMenu)
#define CSIDL_PROGRAMS
Definition: shlobj.h:2005
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
SMDM_TOOLBAR struct tagSMINFO SMINFO
LPARAM lParam
Definition: combotst.c:139
HMENU hmenu
Definition: shobjidl.idl:2617
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
HRESULT OnGetInfo(LPSMDATA psmd, SMINFO *psminfo)
Definition: CStartMenu.cpp:101