ReactOS 0.4.16-dev-1278-gd809cd0
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 AddOrSetMenuItem(HMENU hMenu, UINT nID, INT csidl, BOOL bExpand,
157 BOOL bAdd = TRUE, BOOL bSetText = TRUE) const
158 {
159 MENUITEMINFOW mii = { sizeof(mii), MIIM_ID | MIIM_SUBMENU };
160 mii.wID = nID;
161
162 SHFILEINFOW fileInfo = { 0 };
163 if (bAdd || bSetText)
164 {
165 LPITEMIDLIST pidl;
166 if (SHGetSpecialFolderLocation(NULL, csidl, &pidl) != S_OK)
167 {
168 ERR("SHGetSpecialFolderLocation failed\n");
169 return;
170 }
171
172 SHGetFileInfoW((LPWSTR)pidl, 0, &fileInfo, sizeof(fileInfo),
174 CoTaskMemFree(pidl);
175
176 mii.fMask |= MIIM_TYPE;
177 mii.fType = MFT_STRING;
178 mii.dwTypeData = fileInfo.szDisplayName;
179 }
180
181 if (bExpand)
183
184 if (bAdd)
185 InsertMenuItemW(hMenu, GetMenuItemCount(hMenu), TRUE, &mii);
186 else
187 SetMenuItemInfoW(hMenu, nID, FALSE, &mii);
188 }
189
190 BOOL GetAdvancedValue(LPCWSTR pszName, BOOL bDefault = FALSE) const
191 {
193 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
194 pszName, FALSE, bDefault);
195 }
196
198 {
199 HMENU hMenu = ::CreateMenu();
200 BOOL bAdded = FALSE;
201
202 // My Documents
204 GetAdvancedValue(L"Start_ShowMyDocs", TRUE))
205 {
206 BOOL bExpand = GetAdvancedValue(L"CascadeMyDocuments", FALSE);
208 bAdded = TRUE;
209 }
210
211 // My Pictures
213 GetAdvancedValue(L"Start_ShowMyPics", TRUE))
214 {
215 BOOL bExpand = GetAdvancedValue(L"CascadeMyPictures", FALSE);
217 bAdded = TRUE;
218 }
219
220 if (bAdded)
221 AppendMenuW(hMenu, MF_SEPARATOR, 0, NULL);
222
223 return hMenu;
224 }
225
227 {
228 BOOL bExpand;
229
230 bExpand = GetAdvancedValue(L"CascadeControlPanel");
232
233 bExpand = GetAdvancedValue(L"CascadeNetworkConnections");
235
236 bExpand = GetAdvancedValue(L"CascadePrinters");
238 }
239
241 {
242 CComHeapPtr<ITEMIDLIST> pidlFolder;
243 CComPtr<IShellFolder> psfDesktop;
244 CComPtr<IShellFolder> pShellFolder;
245 HRESULT hr;
246
247 hr = SHGetFolderLocation(NULL, csidl, 0, 0, &pidlFolder);
249 return hr;
250
251 if (psf)
252 {
253 pShellFolder = psf;
254 }
255 else
256 {
257 hr = SHGetDesktopFolder(&psfDesktop);
259 return hr;
260
261 hr = psfDesktop->BindToObject(pidlFolder, NULL, IID_PPV_ARG(IShellFolder, &pShellFolder));
263 return hr;
264 }
265
266 hr = pShellMenu->SetShellFolder(pShellFolder, pidlFolder, NULL, dwFlags);
268 return hr;
269
270 return hr;
271 }
272
273 HRESULT OnGetSubMenu(LPSMDATA psmd, REFIID iid, void ** pv)
274 {
275 HRESULT hr;
276 CComPtr<IShellMenu> pShellMenu;
277
280 return hr;
281
282 hr = pShellMenu->Initialize(this, 0, ANCESTORDEFAULT, SMINIT_VERTICAL);
284 return hr;
285
286 hr = E_FAIL;
287 switch (psmd->uId)
288 {
289 case IDM_PROGRAMS:
290 {
291 hr = AddStartMenuItems(pShellMenu, CSIDL_PROGRAMS, SMSET_TOP, m_psfPrograms);
292 break;
293 }
294 case IDM_FAVORITES:
295 case IDM_MYDOCUMENTS:
296 case IDM_MYPICTURES:
297 case IDM_CONTROLPANEL:
300 {
301 hr = AddStartMenuItems(pShellMenu, CSIDLFromID(psmd->uId), SMSET_TOP);
302 break;
303 }
304 case IDM_DOCUMENTS:
305 {
306 HMENU hMenu = CreateRecentMenu();
307 if (hMenu == NULL)
308 ERR("CreateRecentMenu failed\n");
309
310 hr = pShellMenu->SetMenu(hMenu, NULL, SMSET_BOTTOM);
312 return hr;
313
314 hr = AddStartMenuItems(pShellMenu, CSIDL_RECENT, SMSET_BOTTOM);
315 break;
316 }
317 case IDM_SETTINGS:
318 {
319 MENUITEMINFOW mii = { sizeof(mii), MIIM_SUBMENU };
320 if (GetMenuItemInfoW(psmd->hmenu, psmd->uId, FALSE, &mii))
321 {
323
324 hr = pShellMenu->SetMenu(mii.hSubMenu, NULL, SMSET_BOTTOM);
326 return hr;
327 }
328 break;
329 }
330 default:
331 {
332 MENUITEMINFOW mii = { sizeof(mii), MIIM_SUBMENU };
333 if (GetMenuItemInfoW(psmd->hmenu, psmd->uId, FALSE, &mii))
334 {
335 hr = pShellMenu->SetMenu(mii.hSubMenu, NULL, SMSET_BOTTOM);
337 return hr;
338 }
339 }
340 }
341
342 if (FAILED(hr))
343 return hr;
344
345 hr = pShellMenu->QueryInterface(iid, pv);
346 pShellMenu.Detach();
347 return hr;
348 }
349
351 {
352 switch (uId)
353 {
354 case IDM_PROGRAMS: return CSIDL_PROGRAMS;
355 case IDM_FAVORITES: return CSIDL_FAVORITES;
356 case IDM_DOCUMENTS: return CSIDL_RECENT;
358 case IDM_MYPICTURES: return CSIDL_MYPICTURES;
359 case IDM_CONTROLPANEL: return CSIDL_CONTROLS;
362 default: return 0;
363 }
364 }
365
367 {
368 INT csidl = CSIDLFromID(psmd->uId);
369 if (!csidl)
370 return S_FALSE;
371
372 TRACE("csidl: 0x%X\n", csidl);
373
374 CComHeapPtr<ITEMIDLIST> pidl;
375 SHGetSpecialFolderLocation(NULL, csidl, &pidl);
376
377 CComPtr<IShellFolder> pSF;
378 LPCITEMIDLIST pidlChild = NULL;
379 HRESULT hr = SHBindToParent(pidl, IID_IShellFolder, (void**)&pSF, &pidlChild);
380 if (FAILED(hr))
381 return hr;
382
383 return pSF->GetUIObjectOf(NULL, 1, &pidlChild, IID_IContextMenu, NULL, pv);
384 }
385
386 HRESULT OnGetObject(LPSMDATA psmd, REFIID iid, void ** pv)
387 {
388 if (IsEqualIID(iid, IID_IShellMenu))
389 return OnGetSubMenu(psmd, iid, pv);
390 else if (IsEqualIID(iid, IID_IContextMenu))
391 return OnGetContextMenu(psmd, iid, pv);
392
393 return S_FALSE;
394 }
395
397 {
399
400 // HACK: Because our ShellExecute can't handle CLSID components in paths, we can't launch the paths using the "open" verb.
401 // FIXME: Change this back to using the path as the filename and the "open" verb, once ShellExecute can handle CLSID path components.
402
403 if (psmd->uId == IDM_CONTROLPANEL)
404 ShellExecuteW(NULL, NULL, L"explorer.exe", L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}", NULL, SW_SHOWNORMAL);
405 else if (psmd->uId == IDM_NETWORKCONNECTIONS)
406 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);
407 else if (psmd->uId == IDM_PRINTERSANDFAXES)
408 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);
409 else if (psmd->uId == IDM_MYDOCUMENTS)
410 {
413 else
414 ERR("SHGetSpecialFolderPathW failed\n");
415 }
416 else if (psmd->uId == IDM_MYPICTURES)
417 {
420 else
421 ERR("SHGetSpecialFolderPathW failed\n");
422 }
423 else
425
426 return S_OK;
427 }
428
429public:
430
434 COM_INTERFACE_ENTRY_IID(IID_IShellMenuCallback, IShellMenuCallback)
436
438 IShellMenu* pShellMenu,
439 IBandSite* pBandSite,
440 IDeskBar* pDeskBar)
441 {
442 m_pShellMenu = pShellMenu;
443 m_pBandSite = pBandSite;
444 m_pDeskBar = pDeskBar;
445 }
446
448 {
449 }
450
452 {
453 m_psfPrograms = psf;
454 m_pidlPrograms = pidl;
455 return S_OK;
456 }
457
459 LPSMDATA psmd,
460 UINT uMsg,
463 {
464 switch (uMsg)
465 {
466 case SMC_INITMENU:
467 return OnInitMenu();
468 case SMC_GETINFO:
469 return OnGetInfo(psmd, reinterpret_cast<SMINFO*>(lParam));
470 case SMC_GETOBJECT:
471 return OnGetObject(psmd, *reinterpret_cast<IID *>(wParam), reinterpret_cast<void **>(lParam));
472 case SMC_EXEC:
473 return OnExec(psmd);
474 case SMC_SFEXEC:
475 m_pTrayPriv->Execute(psmd->psf, psmd->pidlItem);
476 break;
477 case 0x10000000: // _FilterPIDL from CMenuSFToolbar
478 if (psmd->psf->CompareIDs(0, psmd->pidlItem, m_pidlPrograms) == 0)
479 return S_OK;
480 return S_FALSE;
481 }
482
483 return S_FALSE;
484 }
485};
486
488{
489 HRESULT hr;
490 CComPtr<IShellFolder> psfDesktop;
491
492 *ppsfResult = NULL;
493
494 hr = SHGetDesktopFolder(&psfDesktop);
495 if (FAILED(hr))
496 return hr;
497
498 hr = psfDesktop->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder, ppsfResult));
499
500 return hr;
501}
502
503static HRESULT GetMergedFolder(int folder1, int folder2, IShellFolder ** ppsfStartMenu)
504{
505 HRESULT hr;
506 LPITEMIDLIST pidlUserStartMenu;
507 LPITEMIDLIST pidlCommonStartMenu;
508 CComPtr<IShellFolder> psfUserStartMenu;
509 CComPtr<IShellFolder> psfCommonStartMenu;
510 CComPtr<IAugmentedShellFolder> pasf;
511
512 *ppsfStartMenu = NULL;
513
514 hr = SHGetSpecialFolderLocation(NULL, folder1, &pidlUserStartMenu);
515 if (FAILED(hr))
516 {
517 WARN("Failed to get the USER start menu folder. Trying to run with just the COMMON one.\n");
518
519 hr = SHGetSpecialFolderLocation(NULL, folder2, &pidlCommonStartMenu);
521 return hr;
522
523 TRACE("COMMON start menu obtained.\n");
524 hr = BindToDesktop(pidlCommonStartMenu, ppsfStartMenu);
525 ILFree(pidlCommonStartMenu);
526 return hr;
527 }
528#if MERGE_FOLDERS
529 hr = SHGetSpecialFolderLocation(NULL, folder2, &pidlCommonStartMenu);
531#else
532 else
533#endif
534 {
535 WARN("Failed to get the COMMON start menu folder. Will use only the USER contents.\n");
536 hr = BindToDesktop(pidlUserStartMenu, ppsfStartMenu);
537 ILFree(pidlUserStartMenu);
538 return hr;
539 }
540
541 TRACE("Both COMMON and USER statr menu folders obtained, merging them...\n");
542
543 hr = BindToDesktop(pidlUserStartMenu, &psfUserStartMenu);
545 return hr;
546
547 hr = BindToDesktop(pidlCommonStartMenu, &psfCommonStartMenu);
549 return hr;
550
551 hr = CMergedFolder_CreateInstance(IID_PPV_ARG(IAugmentedShellFolder, &pasf));
553 {
554 *ppsfStartMenu = psfUserStartMenu.Detach();
555 ILFree(pidlCommonStartMenu);
556 ILFree(pidlUserStartMenu);
557 return hr;
558 }
559
560 hr = pasf->AddNameSpace(NULL, psfUserStartMenu, pidlUserStartMenu, 0xFF00);
562 return hr;
563
564 hr = pasf->AddNameSpace(NULL, psfCommonStartMenu, pidlCommonStartMenu, 0);
566 return hr;
567
568 hr = pasf->QueryInterface(IID_PPV_ARG(IShellFolder, ppsfStartMenu));
569 pasf.Release();
570
571 ILFree(pidlCommonStartMenu);
572 ILFree(pidlUserStartMenu);
573
574 return hr;
575}
576
578{
580}
581
582static HRESULT GetProgramsFolder(IShellFolder ** ppsfStartMenu)
583{
585}
586
587extern "C"
590{
591 CComPtr<IShellMenu> pShellMenu;
592 CComPtr<IBandSite> pBandSite;
593 CComPtr<IDeskBar> pDeskBar;
594
595 HRESULT hr;
596 IShellFolder * psf;
597
598 LPITEMIDLIST pidlProgramsAbsolute;
599 LPITEMIDLIST pidlPrograms;
600 CComPtr<IShellFolder> psfPrograms;
601
604 return hr;
605
608 return hr;
609
612 return hr;
613
614 CComObject<CShellMenuCallback> *pCallback;
615 hr = CComObject<CShellMenuCallback>::CreateInstance(&pCallback);
617 return hr;
618
619 pCallback->AddRef(); // CreateInstance returns object with 0 ref count */
620 pCallback->Initialize(pShellMenu, pBandSite, pDeskBar);
621
622 hr = pShellMenu->Initialize(pCallback, (UINT) -1, 0, SMINIT_TOPLEVEL | SMINIT_VERTICAL);
624 return hr;
625
626 hr = GetStartMenuFolder(&psf);
628 return hr;
629
630 /* psf is a merged folder, so now we want to get the pidl of the programs item from the merged folder */
631 {
632 hr = SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAMS, &pidlProgramsAbsolute);
634 {
635 WARN("USER Programs folder not found\n");
636 hr = SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_PROGRAMS, &pidlProgramsAbsolute);
638 return hr;
639 }
640
641 LPCITEMIDLIST pcidlPrograms;
642 CComPtr<IShellFolder> psfParent;
643 STRRET str;
644 TCHAR szDisplayName[MAX_PATH];
645
646 hr = SHBindToParent(pidlProgramsAbsolute, IID_PPV_ARG(IShellFolder, &psfParent), &pcidlPrograms);
648 return hr;
649
650 hr = psfParent->GetDisplayNameOf(pcidlPrograms, SHGDN_FORPARSING | SHGDN_INFOLDER, &str);
652 return hr;
653
654 StrRetToBuf(&str, pcidlPrograms, szDisplayName, _countof(szDisplayName));
655 ILFree(pidlProgramsAbsolute);
656
657 /* We got the display name from the fs folder and we parse it with the merged folder here */
658 hr = psf->ParseDisplayName(NULL, NULL, szDisplayName, NULL, &pidlPrograms, NULL);
660 return hr;
661 }
662
663 hr = GetProgramsFolder(&psfPrograms);
665 return hr;
666
667 hr = pCallback->_SetProgramsFolder(psfPrograms, pidlPrograms);
669 return hr;
670
671 hr = pShellMenu->SetShellFolder(psf, NULL, NULL, SMSET_TOP);
673 return hr;
674
675 hr = pDeskBar->SetClient(pBandSite);
677 return hr;
678
679 hr = pBandSite->AddBand(pShellMenu);
681 return hr;
682
683 return pDeskBar->QueryInterface(riid, ppv);
684}
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
HRESULT BindToDesktop(LPCITEMIDLIST pidl, IShellFolder **ppsfResult)
Definition: CStartMenu.cpp:487
#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:503
#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:582
#define IDM_SETTINGS
Definition: CStartMenu.cpp:43
HRESULT WINAPI RSHELL_CStartMenu_CreateInstance(REFIID riid, void **ppv)
Definition: CStartMenu.cpp:589
static HRESULT GetStartMenuFolder(IShellFolder **ppsfStartMenu)
Definition: CStartMenu.cpp:577
#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 WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
BOOL GetAdvancedValue(LPCWSTR pszName, BOOL bDefault=FALSE) const
Definition: CStartMenu.cpp:190
HRESULT OnGetObject(LPSMDATA psmd, REFIID iid, void **pv)
Definition: CStartMenu.cpp:386
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:366
HRESULT _SetProgramsFolder(IShellFolder *psf, LPITEMIDLIST pidl)
Definition: CStartMenu.cpp:451
void UpdateSettingsMenu(HMENU hMenu)
Definition: CStartMenu.cpp:226
INT CSIDLFromID(UINT uId) const
Definition: CStartMenu.cpp:350
CComPtr< IShellFolder > m_psfPrograms
Definition: CStartMenu.cpp:69
CComPtr< IShellMenu > m_pShellMenu
Definition: CStartMenu.cpp:65
HMENU CreateRecentMenu() const
Definition: CStartMenu.cpp:197
HRESULT OnGetSubMenu(LPSMDATA psmd, REFIID iid, void **pv)
Definition: CStartMenu.cpp:273
HRESULT STDMETHODCALLTYPE CallbackSM(LPSMDATA psmd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CStartMenu.cpp:458
HRESULT OnExec(LPSMDATA psmd)
Definition: CStartMenu.cpp:396
void AddOrSetMenuItem(HMENU hMenu, UINT nID, INT csidl, BOOL bExpand, BOOL bAdd=TRUE, BOOL bSetText=TRUE) const
Definition: CStartMenu.cpp:156
HRESULT AddStartMenuItems(IShellMenu *pShellMenu, INT csidl, DWORD dwFlags, IShellFolder *psf=NULL)
Definition: CStartMenu.cpp:240
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_FAIL
Definition: ddrawi.h:102
#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
BOOL WINAPI SHRegGetBoolUSValueW(const WCHAR *subkey, const WCHAR *value, BOOL ignore_hkcu, BOOL default_value)
Definition: registry.c:4139
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3384
HRESULT WINAPI SHGetFolderLocation(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3277
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:3219
HRESULT WINAPI IUnknown_GetSite(LPUNKNOWN lpUnknown, REFIID iid, PVOID *lppSite)
Definition: ordinal.c:2642
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1336
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:30
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:844
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
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 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 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
static HMENU hmenu
Definition: win.c:66
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1045
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1498
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
const WCHAR * str
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
Definition: shell32_main.c:430
#define SHGFI_DISPLAYNAME
Definition: shellapi.h:166
#define SHGFI_PIDL
Definition: shellapi.h:180
#define CMenuSite_CreateInstance
Definition: shellmenu.h:86
#define CMergedFolder_CreateInstance
Definition: shellmenu.h:92
#define CMenuDeskBar_CreateInstance
Definition: shellmenu.h:74
#define CMenuBand_CreateInstance
Definition: shellmenu.h:80
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2516
HRESULT hr
Definition: shlfolder.c:183
#define CSIDL_RECENT
Definition: shlobj.h:2189
#define CSIDL_MYDOCUMENTS
Definition: shlobj.h:2193
#define CSIDL_COMMON_STARTMENU
Definition: shlobj.h:2202
#define CSIDL_PERSONAL
Definition: shlobj.h:2186
#define CSIDL_FAVORITES
Definition: shlobj.h:2187
#define CSIDL_CONNECTIONS
Definition: shlobj.h:2229
#define CSIDL_COMMON_PROGRAMS
Definition: shlobj.h:2203
#define CSIDL_MYPICTURES
Definition: shlobj.h:2219
#define CSIDL_PRINTERS
Definition: shlobj.h:2185
#define CSIDL_NETWORK
Definition: shlobj.h:2198
#define CSIDL_STARTMENU
Definition: shlobj.h:2192
#define CSIDL_PROGRAMS
Definition: shlobj.h:2183
@ REST_NOSMMYPICS
Definition: shlobj.h:1766
@ REST_NOSMMYDOCS
Definition: shlobj.h:1764
#define CSIDL_CONTROLS
Definition: shlobj.h:2184
#define StrRetToBuf
Definition: shlwapi.h:1815
@ SMIF_ICON
Definition: shobjidl.idl:2794
@ SMIF_TRACKPOPUP
Definition: shobjidl.idl:2802
@ SMIM_TYPE
Definition: shobjidl.idl:2781
@ SMIM_ICON
Definition: shobjidl.idl:2783
@ SMIM_FLAGS
Definition: shobjidl.idl:2782
@ SMIT_STRING
Definition: shobjidl.idl:2789
@ SMIT_SEPARATOR
Definition: shobjidl.idl:2788
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:166
#define IDM_MYPICTURES
Definition: shresdef.h:911
#define IDI_SHELL_MY_DOCUMENTS
Definition: shresdef.h:712
#define IDI_SHELL_SEARCH1
Definition: shresdef.h:796
#define IDI_SHELL_FAVOTITES
Definition: shresdef.h:795
#define IDI_SHELL_MY_PICTURES
Definition: shresdef.h:713
#define IDI_SHELL_TSKBAR_STARTMENU
Definition: shresdef.h:622
#define IDM_MYDOCUMENTS
Definition: shresdef.h:910
#define IDI_SHELL_PRINTER2
Definition: shresdef.h:641
#define IDI_SHELL_PROGRAMS_FOLDER1
Definition: shresdef.h:799
#define IDI_SHELL_CONTROL_PANEL1
Definition: shresdef.h:803
#define IDI_SHELL_LOGOFF1
Definition: shresdef.h:798
#define IDI_SHELL_RECENT_DOCUMENTS1
Definition: shresdef.h:800
#define IDI_SHELL_SHUTDOWN1
Definition: shresdef.h:802
#define IDI_SHELL_NETWORK_CONNECTIONS2
Definition: shresdef.h:734
#define IDI_SHELL_HELP2
Definition: shresdef.h:797
#define IDI_SHELL_CONTROL_PANEL
Definition: shresdef.h:604
#define IDI_SHELL_RUN1
Definition: shresdef.h:801
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
WCHAR szDisplayName[MAX_PATH]
Definition: shellapi.h:387
LPWSTR dwTypeData
Definition: winuser.h:3345
PUITEMID_CHILD pidlItem
Definition: shobjidl.idl:2753
HMENU hmenu
Definition: shobjidl.idl:2746
IShellFolder * psf
Definition: shobjidl.idl:2754
DWORD dwType
Definition: shobjidl.idl:2765
DWORD dwMask
Definition: shobjidl.idl:2764
DWORD dwFlags
Definition: shobjidl.idl:2766
int32_t INT
Definition: typedefs.h:58
#define SMC_EXEC
Definition: undocshell.h:808
_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:781
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define MIIM_ID
Definition: winuser.h:733
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:1759
BOOL WINAPI SetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
#define MIIM_SUBMENU
Definition: winuser.h:734
#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:757
#define MIIM_TYPE
Definition: winuser.h:736
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
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185