ReactOS 0.4.15-dev-7659-ga55345b
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
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>,
62{
63private:
65 CComPtr<IShellMenu> m_pShellMenu;
66 CComPtr<IBandSite> m_pBandSite;
67 CComPtr<IDeskBar> m_pDeskBar;
68 CComPtr<ITrayPriv> m_pTrayPriv;
69 CComPtr<IShellFolder> m_psfPrograms;
70
72
74 {
76 HRESULT hr;
77
78 if (m_pTrayPriv.p)
79 return S_OK;
80
83 return hr;
84
87 return hr;
88
89 hr = m_pTrayPriv->AppendMenu(&hmenu);
91 return hr;
92
93 hr = m_pShellMenu->SetMenu(hmenu, NULL, SMSET_BOTTOM);
95 {
97 return hr;
98 }
99
100 return hr;
101 }
102
104 {
105 int iconIndex = 0;
106
107 switch (psmd->uId)
108 {
109 // Smaller "24x24" icons used for the start menu
110 // The bitmaps are still 32x32, but the image is centered
111 case IDM_FAVORITES: iconIndex = -IDI_SHELL_FAVOTITES; break;
112 case IDM_SEARCH: iconIndex = -IDI_SHELL_SEARCH1; break;
113 case IDM_HELPANDSUPPORT: iconIndex = -IDI_SHELL_HELP2; break;
114 case IDM_LOGOFF: iconIndex = -IDI_SHELL_LOGOFF1; break;
115 case IDM_PROGRAMS: iconIndex = -IDI_SHELL_PROGRAMS_FOLDER1; break;
116 case IDM_DOCUMENTS: iconIndex = -IDI_SHELL_RECENT_DOCUMENTS1; break;
117 case IDM_RUN: iconIndex = -IDI_SHELL_RUN1; break;
118 case IDM_SHUTDOWN: iconIndex = -IDI_SHELL_SHUTDOWN1; break;
119 case IDM_SETTINGS: iconIndex = -IDI_SHELL_CONTROL_PANEL1; break;
120 case IDM_MYDOCUMENTS: iconIndex = -IDI_SHELL_MY_DOCUMENTS; break;
121 case IDM_MYPICTURES: iconIndex = -IDI_SHELL_MY_PICTURES; break;
122
123 case IDM_CONTROLPANEL: iconIndex = -IDI_SHELL_CONTROL_PANEL; break;
125 case IDM_PRINTERSANDFAXES: iconIndex = -IDI_SHELL_PRINTER2; break;
126 case IDM_TASKBARANDSTARTMENU: iconIndex = -IDI_SHELL_TSKBAR_STARTMENU; break;
127 //case IDM_SECURITY: iconIndex = -21; break;
128 //case IDM_SYNCHRONIZE: iconIndex = -21; break;
129 //case IDM_DISCONNECT: iconIndex = -21; break;
130 //case IDM_UNDOCKCOMPUTER: iconIndex = -21; break;
131 default:
132 return S_FALSE;
133 }
134
135 if (iconIndex)
136 {
137 if ((psminfo->dwMask & SMIM_TYPE) != 0)
138 psminfo->dwType = SMIT_STRING;
139 if ((psminfo->dwMask & SMIM_ICON) != 0)
140 psminfo->iIcon = Shell_GetCachedImageIndex(L"shell32.dll", iconIndex, FALSE);
141 if ((psminfo->dwMask & SMIM_FLAGS) != 0)
142 psminfo->dwFlags |= SMIF_ICON;
143#ifdef TEST_TRACKPOPUPMENU_SUBMENUS
144 if ((psminfo->dwMask & SMIM_FLAGS) != 0)
145 psminfo->dwFlags |= SMIF_TRACKPOPUP;
146#endif
147 }
148 else
149 {
150 if ((psminfo->dwMask & SMIM_TYPE) != 0)
151 psminfo->dwType = SMIT_SEPARATOR;
152 }
153 return S_OK;
154 }
155
156 void InsertRecentItem(HMENU hMenu, UINT nID, INT csidl, BOOL bExpand) const
157 {
160 {
161 ERR("SHGetSpecialFolderPathW failed\n");
162 return;
163 }
164
166 if (bExpand)
167 {
168 MENUITEMINFOW mii = { sizeof(mii), MIIM_TYPE | MIIM_ID | MIIM_SUBMENU };
169 mii.fType = MFT_STRING;
170 mii.wID = nID;
172 mii.dwTypeData = pszText;
173 mii.cch = lstrlenW(pszText);
174 InsertMenuItemW(hMenu, GetMenuItemCount(hMenu), TRUE, &mii);
175 }
176 else
177 {
178 AppendMenuW(hMenu, MF_STRING | MF_ENABLED, nID, pszText);
179 }
180 }
181
182 HMENU CreateRecentMenu(BOOL bExpandMyDocuments, BOOL bExpandMyPictures) const
183 {
184 HMENU hMenu = ::CreateMenu();
185 InsertRecentItem(hMenu, IDM_MYDOCUMENTS, CSIDL_MYDOCUMENTS, bExpandMyDocuments);
186 InsertRecentItem(hMenu, IDM_MYPICTURES, CSIDL_MYPICTURES, bExpandMyPictures);
187 AppendMenuW(hMenu, MF_SEPARATOR, 0, NULL);
188 return hMenu;
189 }
190
191 HRESULT OnGetSubMenu(LPSMDATA psmd, REFIID iid, void ** pv)
192 {
193 HRESULT hr;
194 int csidl = 0;
195 IShellMenu *pShellMenu;
196
199 return hr;
200
201 hr = pShellMenu->Initialize(this, 0, ANCESTORDEFAULT, SMINIT_VERTICAL);
203 return hr;
204
205 switch (psmd->uId)
206 {
207 case IDM_PROGRAMS: csidl = CSIDL_PROGRAMS; break;
208 case IDM_FAVORITES: csidl = CSIDL_FAVORITES; break;
209 case IDM_DOCUMENTS: csidl = CSIDL_RECENT; break;
210 case IDM_MYDOCUMENTS: csidl = CSIDL_MYDOCUMENTS; break;
211 case IDM_MYPICTURES: csidl = CSIDL_MYPICTURES; break;
212 }
213
214 if (csidl)
215 {
216 IShellFolder *psfStartMenu;
217 DWORD dwFlags = SMSET_TOP;
218
219 if (csidl == CSIDL_PROGRAMS && m_psfPrograms)
220 {
221 psfStartMenu = m_psfPrograms;
222 }
223 else
224 {
225 if (csidl == CSIDL_RECENT)
226 {
227 BOOL bExpandMyDocuments = FALSE; /* FIXME: Get value from registry */
228 BOOL bExpandMyPictures = FALSE; /* FIXME: Get value from registry */
229 HMENU hMenu = CreateRecentMenu(bExpandMyDocuments, bExpandMyPictures);
230 if (hMenu == NULL)
231 ERR("CreateRecentMenu failed\n");
232
233 hr = pShellMenu->SetMenu(hMenu, NULL, SMSET_BOTTOM);
235 return hr;
236
237 dwFlags = SMSET_BOTTOM;
238 }
239
240 LPITEMIDLIST pidlStartMenu;
241 IShellFolder *psfDestop;
242 hr = SHGetFolderLocation(NULL, csidl, 0, 0, &pidlStartMenu);
244 return hr;
245
246 hr = SHGetDesktopFolder(&psfDestop);
248 return hr;
249
250 hr = psfDestop->BindToObject(pidlStartMenu, NULL, IID_PPV_ARG(IShellFolder, &psfStartMenu));
252 return hr;
253 }
254
255 hr = pShellMenu->SetShellFolder(psfStartMenu, NULL, NULL, dwFlags);
257 return hr;
258 }
259 else
260 {
261 MENUITEMINFO mii;
262 mii.cbSize = sizeof(mii);
263 mii.fMask = MIIM_SUBMENU;
264 if (GetMenuItemInfoW(psmd->hmenu, psmd->uId, FALSE, &mii))
265 {
266 hr = pShellMenu->SetMenu(mii.hSubMenu, NULL, SMSET_BOTTOM);
268 return hr;
269 }
270 }
271 return pShellMenu->QueryInterface(iid, pv);
272 }
273
275 {
276 if (psmd->uId == IDM_PROGRAMS ||
277 psmd->uId == IDM_CONTROLPANEL ||
278 psmd->uId == IDM_NETWORKCONNECTIONS ||
279 psmd->uId == IDM_PRINTERSANDFAXES)
280 {
281 //UNIMPLEMENTED
282 }
283
284 return S_FALSE;
285 }
286
287 HRESULT OnGetObject(LPSMDATA psmd, REFIID iid, void ** pv)
288 {
289 if (IsEqualIID(iid, IID_IShellMenu))
290 return OnGetSubMenu(psmd, iid, pv);
291 else if (IsEqualIID(iid, IID_IContextMenu))
292 return OnGetContextMenu(psmd, iid, pv);
293
294 return S_FALSE;
295 }
296
298 {
300
301 // HACK: Because our ShellExecute can't handle CLSID components in paths, we can't launch the paths using the "open" verb.
302 // FIXME: Change this back to using the path as the filename and the "open" verb, once ShellExecute can handle CLSID path components.
303
304 if (psmd->uId == IDM_CONTROLPANEL)
305 ShellExecuteW(NULL, NULL, L"explorer.exe", L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}", NULL, SW_SHOWNORMAL);
306 else if (psmd->uId == IDM_NETWORKCONNECTIONS)
307 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);
308 else if (psmd->uId == IDM_PRINTERSANDFAXES)
309 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);
310 else if (psmd->uId == IDM_MYDOCUMENTS)
311 {
314 else
315 ERR("SHGetSpecialFolderPathW failed\n");
316 }
317 else if (psmd->uId == IDM_MYPICTURES)
318 {
321 else
322 ERR("SHGetSpecialFolderPathW failed\n");
323 }
324 else
326
327 return S_OK;
328 }
329
330public:
331
335 COM_INTERFACE_ENTRY_IID(IID_IShellMenuCallback, IShellMenuCallback)
337
339 IShellMenu* pShellMenu,
340 IBandSite* pBandSite,
341 IDeskBar* pDeskBar)
342 {
343 m_pShellMenu = pShellMenu;
344 m_pBandSite = pBandSite;
345 m_pDeskBar = pDeskBar;
346 }
347
349 {
350 }
351
353 {
354 m_psfPrograms = psf;
355 m_pidlPrograms = pidl;
356 return S_OK;
357 }
358
360 LPSMDATA psmd,
361 UINT uMsg,
364 {
365 switch (uMsg)
366 {
367 case SMC_INITMENU:
368 return OnInitMenu();
369 case SMC_GETINFO:
370 return OnGetInfo(psmd, reinterpret_cast<SMINFO*>(lParam));
371 case SMC_GETOBJECT:
372 return OnGetObject(psmd, *reinterpret_cast<IID *>(wParam), reinterpret_cast<void **>(lParam));
373 case SMC_EXEC:
374 return OnExec(psmd);
375 case SMC_SFEXEC:
376 m_pTrayPriv->Execute(psmd->psf, psmd->pidlItem);
377 break;
378 case 0x10000000: // _FilterPIDL from CMenuSFToolbar
379 if (psmd->psf->CompareIDs(0, psmd->pidlItem, m_pidlPrograms) == 0)
380 return S_OK;
381 return S_FALSE;
382 }
383
384 return S_FALSE;
385 }
386};
387
389{
390 HRESULT hr;
391 CComPtr<IShellFolder> psfDesktop;
392
393 *ppsfResult = NULL;
394
395 hr = SHGetDesktopFolder(&psfDesktop);
396 if (FAILED(hr))
397 return hr;
398
399 hr = psfDesktop->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder, ppsfResult));
400
401 return hr;
402}
403
404static HRESULT GetMergedFolder(int folder1, int folder2, IShellFolder ** ppsfStartMenu)
405{
406 HRESULT hr;
407 LPITEMIDLIST pidlUserStartMenu;
408 LPITEMIDLIST pidlCommonStartMenu;
409 CComPtr<IShellFolder> psfUserStartMenu;
410 CComPtr<IShellFolder> psfCommonStartMenu;
411 CComPtr<IAugmentedShellFolder> pasf;
412
413 *ppsfStartMenu = NULL;
414
415 hr = SHGetSpecialFolderLocation(NULL, folder1, &pidlUserStartMenu);
416 if (FAILED(hr))
417 {
418 WARN("Failed to get the USER start menu folder. Trying to run with just the COMMON one.\n");
419
420 hr = SHGetSpecialFolderLocation(NULL, folder2, &pidlCommonStartMenu);
422 return hr;
423
424 TRACE("COMMON start menu obtained.\n");
425 hr = BindToDesktop(pidlCommonStartMenu, ppsfStartMenu);
426 ILFree(pidlCommonStartMenu);
427 return hr;
428 }
429#if MERGE_FOLDERS
430 hr = SHGetSpecialFolderLocation(NULL, folder2, &pidlCommonStartMenu);
432#else
433 else
434#endif
435 {
436 WARN("Failed to get the COMMON start menu folder. Will use only the USER contents.\n");
437 hr = BindToDesktop(pidlUserStartMenu, ppsfStartMenu);
438 ILFree(pidlUserStartMenu);
439 return hr;
440 }
441
442 TRACE("Both COMMON and USER statr menu folders obtained, merging them...\n");
443
444 hr = BindToDesktop(pidlUserStartMenu, &psfUserStartMenu);
446 return hr;
447
448 hr = BindToDesktop(pidlCommonStartMenu, &psfCommonStartMenu);
450 return hr;
451
452 hr = CMergedFolder_CreateInstance(IID_PPV_ARG(IAugmentedShellFolder, &pasf));
454 {
455 *ppsfStartMenu = psfUserStartMenu.Detach();
456 ILFree(pidlCommonStartMenu);
457 ILFree(pidlUserStartMenu);
458 return hr;
459 }
460
461 hr = pasf->AddNameSpace(NULL, psfUserStartMenu, pidlUserStartMenu, 0xFF00);
463 return hr;
464
465 hr = pasf->AddNameSpace(NULL, psfCommonStartMenu, pidlCommonStartMenu, 0);
467 return hr;
468
469 hr = pasf->QueryInterface(IID_PPV_ARG(IShellFolder, ppsfStartMenu));
470 pasf.Release();
471
472 ILFree(pidlCommonStartMenu);
473 ILFree(pidlUserStartMenu);
474
475 return hr;
476}
477
479{
481}
482
483static HRESULT GetProgramsFolder(IShellFolder ** ppsfStartMenu)
484{
486}
487
488extern "C"
491{
492 CComPtr<IShellMenu> pShellMenu;
493 CComPtr<IBandSite> pBandSite;
494 CComPtr<IDeskBar> pDeskBar;
495
496 HRESULT hr;
497 IShellFolder * psf;
498
499 LPITEMIDLIST pidlProgramsAbsolute;
500 LPITEMIDLIST pidlPrograms;
501 CComPtr<IShellFolder> psfPrograms;
502
505 return hr;
506
509 return hr;
510
513 return hr;
514
515 CComObject<CShellMenuCallback> *pCallback;
516 hr = CComObject<CShellMenuCallback>::CreateInstance(&pCallback);
518 return hr;
519
520 pCallback->AddRef(); // CreateInstance returns object with 0 ref count */
521 pCallback->Initialize(pShellMenu, pBandSite, pDeskBar);
522
523 hr = pShellMenu->Initialize(pCallback, (UINT) -1, 0, SMINIT_TOPLEVEL | SMINIT_VERTICAL);
525 return hr;
526
527 hr = GetStartMenuFolder(&psf);
529 return hr;
530
531 /* psf is a merged folder, so now we want to get the pidl of the programs item from the merged folder */
532 {
533 hr = SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAMS, &pidlProgramsAbsolute);
535 {
536 WARN("USER Programs folder not found\n");
537 hr = SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_PROGRAMS, &pidlProgramsAbsolute);
539 return hr;
540 }
541
542 LPCITEMIDLIST pcidlPrograms;
543 CComPtr<IShellFolder> psfParent;
544 STRRET str;
545 TCHAR szDisplayName[MAX_PATH];
546
547 hr = SHBindToParent(pidlProgramsAbsolute, IID_PPV_ARG(IShellFolder, &psfParent), &pcidlPrograms);
549 return hr;
550
551 hr = psfParent->GetDisplayNameOf(pcidlPrograms, SHGDN_FORPARSING | SHGDN_INFOLDER, &str);
553 return hr;
554
555 StrRetToBuf(&str, pcidlPrograms, szDisplayName, _countof(szDisplayName));
556 ILFree(pidlProgramsAbsolute);
557
558 /* We got the display name from the fs folder and we parse it with the merged folder here */
559 hr = psf->ParseDisplayName(NULL, NULL, szDisplayName, NULL, &pidlPrograms, NULL);
561 return hr;
562 }
563
564 hr = GetProgramsFolder(&psfPrograms);
566 return hr;
567
568 hr = pCallback->_SetProgramsFolder(psfPrograms, pidlPrograms);
570 return hr;
571
572 hr = pShellMenu->SetShellFolder(psf, NULL, NULL, SMSET_TOP);
574 return hr;
575
576 hr = pDeskBar->SetClient(pBandSite);
578 return hr;
579
580 hr = pBandSite->AddBand(pShellMenu);
582 return hr;
583
584 return pDeskBar->QueryInterface(riid, ppv);
585}
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
HRESULT BindToDesktop(LPCITEMIDLIST pidl, IShellFolder **ppsfResult)
Definition: CStartMenu.cpp:388
#define IDM_SEARCH
Definition: CStartMenu.cpp:45
#define IDM_FAVORITES
Definition: CStartMenu.cpp:42
static HRESULT GetMergedFolder(int folder1, int folder2, IShellFolder **ppsfStartMenu)
Definition: CStartMenu.cpp:404
#define IDM_NETWORKCONNECTIONS
Definition: CStartMenu.cpp:47
#define IDM_SHUTDOWN
Definition: CStartMenu.cpp:41
#define IDM_CONTROLPANEL
Definition: CStartMenu.cpp:40
#define IDM_PRINTERSANDFAXES
Definition: CStartMenu.cpp:44
static HRESULT GetProgramsFolder(IShellFolder **ppsfStartMenu)
Definition: CStartMenu.cpp:483
#define IDM_SETTINGS
Definition: CStartMenu.cpp:43
HRESULT WINAPI RSHELL_CStartMenu_CreateInstance(REFIID riid, void **ppv)
Definition: CStartMenu.cpp:490
static HRESULT GetStartMenuFolder(IShellFolder **ppsfStartMenu)
Definition: CStartMenu.cpp:478
#define IDM_RUN
Definition: CStartMenu.cpp:32
#define IDM_PROGRAMS
Definition: CStartMenu.cpp:39
#define IDM_HELPANDSUPPORT
Definition: CStartMenu.cpp:38
#define IDM_DOCUMENTS
Definition: CStartMenu.cpp:37
#define IDM_LOGOFF
Definition: CStartMenu.cpp:33
#define IDM_TASKBARANDSTARTMENU
Definition: CStartMenu.cpp:35
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
#define WARN(fmt,...)
Definition: debug.h:112
#define ERR(fmt,...)
Definition: debug.h:110
HRESULT OnGetObject(LPSMDATA psmd, REFIID iid, void **pv)
Definition: CStartMenu.cpp:287
HMENU CreateRecentMenu(BOOL bExpandMyDocuments, BOOL bExpandMyPictures) const
Definition: CStartMenu.cpp:182
LPITEMIDLIST m_pidlPrograms
Definition: CStartMenu.cpp:71
CComPtr< ITrayPriv > m_pTrayPriv
Definition: CStartMenu.cpp:68
CComPtr< IBandSite > m_pBandSite
Definition: CStartMenu.cpp:66
CComPtr< IDeskBar > m_pDeskBar
Definition: CStartMenu.cpp:67
HRESULT OnGetInfo(LPSMDATA psmd, SMINFO *psminfo)
Definition: CStartMenu.cpp:103
HRESULT OnInitMenu()
Definition: CStartMenu.cpp:73
HRESULT OnGetContextMenu(LPSMDATA psmd, REFIID iid, void **pv)
Definition: CStartMenu.cpp:274
HRESULT _SetProgramsFolder(IShellFolder *psf, LPITEMIDLIST pidl)
Definition: CStartMenu.cpp:352
CComPtr< IShellFolder > m_psfPrograms
Definition: CStartMenu.cpp:69
CComPtr< IShellMenu > m_pShellMenu
Definition: CStartMenu.cpp:65
HRESULT OnGetSubMenu(LPSMDATA psmd, REFIID iid, void **pv)
Definition: CStartMenu.cpp:191
HRESULT STDMETHODCALLTYPE CallbackSM(LPSMDATA psmd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CStartMenu.cpp:359
HRESULT OnExec(LPSMDATA psmd)
Definition: CStartMenu.cpp:297
void InsertRecentItem(HMENU hMenu, UINT nID, INT csidl, BOOL bExpand) const
Definition: CStartMenu.cpp:156
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
#define lstrlenW
Definition: compat.h:750
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3194
HRESULT WINAPI SHGetFolderLocation(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3093
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:3061
HRESULT WINAPI IUnknown_GetSite(LPUNKNOWN lpUnknown, REFIID iid, PVOID *lppSite)
Definition: ordinal.c:2596
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1332
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxPnpStateCallbackInfo * pCallback
EXTERN_C INT WINAPI Shell_GetCachedImageIndex(LPCWSTR szPath, INT nIndex, UINT bSimulateDoc)
Definition: iconcache.cpp:855
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT ParseDisplayName([in] HWND hwndOwner, [in] LPBC pbcReserved, [in, string] LPOLESTR lpszDisplayName, [out] ULONG *pchEaten, [out] PIDLIST_RELATIVE *ppidl, [in, out, unique] ULONG *pdwAttributes)
HRESULT BindToObject([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
HRESULT CompareIDs([in] LPARAM lParam, [in] PCUIDLIST_RELATIVE pidl1, [in] PCUIDLIST_RELATIVE pidl2)
HRESULT SetShellFolder([in] IShellFolder *psf, [in] PCIDLIST_ABSOLUTE pidlFolder, [in] HKEY hKey, [in] DWORD dwFlags)
HRESULT Initialize([in] IShellMenuCallback *psmc, [in] UINT uId, [in] UINT uIdAncestor, [in] DWORD dwFlags)
HRESULT SetMenu([in] HMENU hmenu, [in] HWND hwnd, [in] DWORD dwFlags)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
ULONG Release()
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:679
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:651
#define END_COM_MAP()
Definition: atlcom.h:592
LPCWSTR szPath
Definition: env.c:37
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:929
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1352
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
const WCHAR * str
#define CMenuSite_CreateInstance
Definition: shellmenu.h:87
#define CMergedFolder_CreateInstance
Definition: shellmenu.h:93
#define CMenuDeskBar_CreateInstance
Definition: shellmenu.h:75
#define CMenuBand_CreateInstance
Definition: shellmenu.h:81
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2379
HRESULT hr
Definition: shlfolder.c:183
#define CSIDL_RECENT
Definition: shlobj.h:2099
#define CSIDL_MYDOCUMENTS
Definition: shlobj.h:2103
#define CSIDL_COMMON_STARTMENU
Definition: shlobj.h:2112
#define CSIDL_PERSONAL
Definition: shlobj.h:2096
#define CSIDL_FAVORITES
Definition: shlobj.h:2097
#define CSIDL_COMMON_PROGRAMS
Definition: shlobj.h:2113
#define CSIDL_MYPICTURES
Definition: shlobj.h:2129
#define CSIDL_STARTMENU
Definition: shlobj.h:2102
#define CSIDL_PROGRAMS
Definition: shlobj.h:2093
#define StrRetToBuf
Definition: shlwapi.h:1769
@ SMIF_ICON
Definition: shobjidl.idl:2708
@ SMIF_TRACKPOPUP
Definition: shobjidl.idl:2716
@ SMIM_TYPE
Definition: shobjidl.idl:2695
@ SMIM_ICON
Definition: shobjidl.idl:2697
@ SMIM_FLAGS
Definition: shobjidl.idl:2696
@ SMIT_STRING
Definition: shobjidl.idl:2703
@ SMIT_SEPARATOR
Definition: shobjidl.idl:2702
#define IDM_MYPICTURES
Definition: shresdef.h:861
#define IDI_SHELL_MY_DOCUMENTS
Definition: shresdef.h:663
#define IDI_SHELL_SEARCH1
Definition: shresdef.h:747
#define IDI_SHELL_FAVOTITES
Definition: shresdef.h:746
#define IDI_SHELL_MY_PICTURES
Definition: shresdef.h:664
#define IDI_SHELL_TSKBAR_STARTMENU
Definition: shresdef.h:577
#define IDM_MYDOCUMENTS
Definition: shresdef.h:860
#define IDI_SHELL_PRINTER2
Definition: shresdef.h:592
#define IDI_SHELL_PROGRAMS_FOLDER1
Definition: shresdef.h:750
#define IDI_SHELL_CONTROL_PANEL1
Definition: shresdef.h:754
#define IDI_SHELL_LOGOFF1
Definition: shresdef.h:749
#define IDI_SHELL_RECENT_DOCUMENTS1
Definition: shresdef.h:751
#define IDI_SHELL_SHUTDOWN1
Definition: shresdef.h:753
#define IDI_SHELL_NETWORK_CONNECTIONS2
Definition: shresdef.h:685
#define IDI_SHELL_HELP2
Definition: shresdef.h:748
#define IDI_SHELL_CONTROL_PANEL
Definition: shresdef.h:559
#define IDI_SHELL_RUN1
Definition: shresdef.h:752
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define _countof(array)
Definition: sndvol32.h:68
#define TRACE(s)
Definition: solgame.cpp:4
LPWSTR dwTypeData
Definition: winuser.h:3268
PUITEMID_CHILD pidlItem
Definition: shobjidl.idl:2667
HMENU hmenu
Definition: shobjidl.idl:2660
IShellFolder * psf
Definition: shobjidl.idl:2668
DWORD dwType
Definition: shobjidl.idl:2679
DWORD dwMask
Definition: shobjidl.idl:2678
DWORD dwFlags
Definition: shobjidl.idl:2680
int32_t INT
Definition: typedefs.h:58
#define SMC_EXEC
Definition: undocshell.h:667
static HMENU hmenu
Definition: win.c:66
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define SW_SHOWNORMAL
Definition: winuser.h:769
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define MIIM_ID
Definition: winuser.h:722
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMENU WINAPI CreateMenu(void)
Definition: menu.c:829
#define WM_COMMAND
Definition: winuser.h:1739
#define MF_STRING
Definition: winuser.h:138
#define MIIM_SUBMENU
Definition: winuser.h:723
#define MF_ENABLED
Definition: winuser.h:128
#define MF_SEPARATOR
Definition: winuser.h:137
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
#define MFT_STRING
Definition: winuser.h:746
#define MIIM_TYPE
Definition: winuser.h:725
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
BOOL WINAPI AppendMenuW(_In_ HMENU, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
static void Initialize()
Definition: xlate.c:212
#define IID_PPV_ARG(Itype, ppType)
char TCHAR
Definition: xmlstorage.h:189
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184