ReactOS 0.4.15-dev-8222-g9164419
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 if (csidl == CSIDL_CONTROLS || csidl == CSIDL_NETWORK || csidl == CSIDL_PRINTERS)
375 FIXME("This CSIDL %d wrongly opens My Computer. CORE-19477\n", csidl);
376
377 CComHeapPtr<ITEMIDLIST> pidl;
378 SHGetSpecialFolderLocation(NULL, csidl, &pidl);
379
380 CComPtr<IShellFolder> pSF;
381 LPCITEMIDLIST pidlChild = NULL;
382 HRESULT hr = SHBindToParent(pidl, IID_IShellFolder, (void**)&pSF, &pidlChild);
383 if (FAILED(hr))
384 return hr;
385
386 return pSF->GetUIObjectOf(NULL, 1, &pidlChild, IID_IContextMenu, NULL, pv);
387 }
388
389 HRESULT OnGetObject(LPSMDATA psmd, REFIID iid, void ** pv)
390 {
391 if (IsEqualIID(iid, IID_IShellMenu))
392 return OnGetSubMenu(psmd, iid, pv);
393 else if (IsEqualIID(iid, IID_IContextMenu))
394 return OnGetContextMenu(psmd, iid, pv);
395
396 return S_FALSE;
397 }
398
400 {
402
403 // HACK: Because our ShellExecute can't handle CLSID components in paths, we can't launch the paths using the "open" verb.
404 // FIXME: Change this back to using the path as the filename and the "open" verb, once ShellExecute can handle CLSID path components.
405
406 if (psmd->uId == IDM_CONTROLPANEL)
407 ShellExecuteW(NULL, NULL, L"explorer.exe", L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}", NULL, SW_SHOWNORMAL);
408 else if (psmd->uId == IDM_NETWORKCONNECTIONS)
409 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);
410 else if (psmd->uId == IDM_PRINTERSANDFAXES)
411 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);
412 else if (psmd->uId == IDM_MYDOCUMENTS)
413 {
416 else
417 ERR("SHGetSpecialFolderPathW failed\n");
418 }
419 else if (psmd->uId == IDM_MYPICTURES)
420 {
423 else
424 ERR("SHGetSpecialFolderPathW failed\n");
425 }
426 else
428
429 return S_OK;
430 }
431
432public:
433
437 COM_INTERFACE_ENTRY_IID(IID_IShellMenuCallback, IShellMenuCallback)
439
441 IShellMenu* pShellMenu,
442 IBandSite* pBandSite,
443 IDeskBar* pDeskBar)
444 {
445 m_pShellMenu = pShellMenu;
446 m_pBandSite = pBandSite;
447 m_pDeskBar = pDeskBar;
448 }
449
451 {
452 }
453
455 {
456 m_psfPrograms = psf;
457 m_pidlPrograms = pidl;
458 return S_OK;
459 }
460
462 LPSMDATA psmd,
463 UINT uMsg,
466 {
467 switch (uMsg)
468 {
469 case SMC_INITMENU:
470 return OnInitMenu();
471 case SMC_GETINFO:
472 return OnGetInfo(psmd, reinterpret_cast<SMINFO*>(lParam));
473 case SMC_GETOBJECT:
474 return OnGetObject(psmd, *reinterpret_cast<IID *>(wParam), reinterpret_cast<void **>(lParam));
475 case SMC_EXEC:
476 return OnExec(psmd);
477 case SMC_SFEXEC:
478 m_pTrayPriv->Execute(psmd->psf, psmd->pidlItem);
479 break;
480 case 0x10000000: // _FilterPIDL from CMenuSFToolbar
481 if (psmd->psf->CompareIDs(0, psmd->pidlItem, m_pidlPrograms) == 0)
482 return S_OK;
483 return S_FALSE;
484 }
485
486 return S_FALSE;
487 }
488};
489
491{
492 HRESULT hr;
493 CComPtr<IShellFolder> psfDesktop;
494
495 *ppsfResult = NULL;
496
497 hr = SHGetDesktopFolder(&psfDesktop);
498 if (FAILED(hr))
499 return hr;
500
501 hr = psfDesktop->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder, ppsfResult));
502
503 return hr;
504}
505
506static HRESULT GetMergedFolder(int folder1, int folder2, IShellFolder ** ppsfStartMenu)
507{
508 HRESULT hr;
509 LPITEMIDLIST pidlUserStartMenu;
510 LPITEMIDLIST pidlCommonStartMenu;
511 CComPtr<IShellFolder> psfUserStartMenu;
512 CComPtr<IShellFolder> psfCommonStartMenu;
513 CComPtr<IAugmentedShellFolder> pasf;
514
515 *ppsfStartMenu = NULL;
516
517 hr = SHGetSpecialFolderLocation(NULL, folder1, &pidlUserStartMenu);
518 if (FAILED(hr))
519 {
520 WARN("Failed to get the USER start menu folder. Trying to run with just the COMMON one.\n");
521
522 hr = SHGetSpecialFolderLocation(NULL, folder2, &pidlCommonStartMenu);
524 return hr;
525
526 TRACE("COMMON start menu obtained.\n");
527 hr = BindToDesktop(pidlCommonStartMenu, ppsfStartMenu);
528 ILFree(pidlCommonStartMenu);
529 return hr;
530 }
531#if MERGE_FOLDERS
532 hr = SHGetSpecialFolderLocation(NULL, folder2, &pidlCommonStartMenu);
534#else
535 else
536#endif
537 {
538 WARN("Failed to get the COMMON start menu folder. Will use only the USER contents.\n");
539 hr = BindToDesktop(pidlUserStartMenu, ppsfStartMenu);
540 ILFree(pidlUserStartMenu);
541 return hr;
542 }
543
544 TRACE("Both COMMON and USER statr menu folders obtained, merging them...\n");
545
546 hr = BindToDesktop(pidlUserStartMenu, &psfUserStartMenu);
548 return hr;
549
550 hr = BindToDesktop(pidlCommonStartMenu, &psfCommonStartMenu);
552 return hr;
553
554 hr = CMergedFolder_CreateInstance(IID_PPV_ARG(IAugmentedShellFolder, &pasf));
556 {
557 *ppsfStartMenu = psfUserStartMenu.Detach();
558 ILFree(pidlCommonStartMenu);
559 ILFree(pidlUserStartMenu);
560 return hr;
561 }
562
563 hr = pasf->AddNameSpace(NULL, psfUserStartMenu, pidlUserStartMenu, 0xFF00);
565 return hr;
566
567 hr = pasf->AddNameSpace(NULL, psfCommonStartMenu, pidlCommonStartMenu, 0);
569 return hr;
570
571 hr = pasf->QueryInterface(IID_PPV_ARG(IShellFolder, ppsfStartMenu));
572 pasf.Release();
573
574 ILFree(pidlCommonStartMenu);
575 ILFree(pidlUserStartMenu);
576
577 return hr;
578}
579
581{
583}
584
585static HRESULT GetProgramsFolder(IShellFolder ** ppsfStartMenu)
586{
588}
589
590extern "C"
593{
594 CComPtr<IShellMenu> pShellMenu;
595 CComPtr<IBandSite> pBandSite;
596 CComPtr<IDeskBar> pDeskBar;
597
598 HRESULT hr;
599 IShellFolder * psf;
600
601 LPITEMIDLIST pidlProgramsAbsolute;
602 LPITEMIDLIST pidlPrograms;
603 CComPtr<IShellFolder> psfPrograms;
604
607 return hr;
608
611 return hr;
612
615 return hr;
616
617 CComObject<CShellMenuCallback> *pCallback;
618 hr = CComObject<CShellMenuCallback>::CreateInstance(&pCallback);
620 return hr;
621
622 pCallback->AddRef(); // CreateInstance returns object with 0 ref count */
623 pCallback->Initialize(pShellMenu, pBandSite, pDeskBar);
624
625 hr = pShellMenu->Initialize(pCallback, (UINT) -1, 0, SMINIT_TOPLEVEL | SMINIT_VERTICAL);
627 return hr;
628
629 hr = GetStartMenuFolder(&psf);
631 return hr;
632
633 /* psf is a merged folder, so now we want to get the pidl of the programs item from the merged folder */
634 {
635 hr = SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAMS, &pidlProgramsAbsolute);
637 {
638 WARN("USER Programs folder not found\n");
639 hr = SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_PROGRAMS, &pidlProgramsAbsolute);
641 return hr;
642 }
643
644 LPCITEMIDLIST pcidlPrograms;
645 CComPtr<IShellFolder> psfParent;
646 STRRET str;
647 TCHAR szDisplayName[MAX_PATH];
648
649 hr = SHBindToParent(pidlProgramsAbsolute, IID_PPV_ARG(IShellFolder, &psfParent), &pcidlPrograms);
651 return hr;
652
653 hr = psfParent->GetDisplayNameOf(pcidlPrograms, SHGDN_FORPARSING | SHGDN_INFOLDER, &str);
655 return hr;
656
657 StrRetToBuf(&str, pcidlPrograms, szDisplayName, _countof(szDisplayName));
658 ILFree(pidlProgramsAbsolute);
659
660 /* We got the display name from the fs folder and we parse it with the merged folder here */
661 hr = psf->ParseDisplayName(NULL, NULL, szDisplayName, NULL, &pidlPrograms, NULL);
663 return hr;
664 }
665
666 hr = GetProgramsFolder(&psfPrograms);
668 return hr;
669
670 hr = pCallback->_SetProgramsFolder(psfPrograms, pidlPrograms);
672 return hr;
673
674 hr = pShellMenu->SetShellFolder(psf, NULL, NULL, SMSET_TOP);
676 return hr;
677
678 hr = pDeskBar->SetClient(pBandSite);
680 return hr;
681
682 hr = pBandSite->AddBand(pShellMenu);
684 return hr;
685
686 return pDeskBar->QueryInterface(riid, ppv);
687}
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
HRESULT BindToDesktop(LPCITEMIDLIST pidl, IShellFolder **ppsfResult)
Definition: CStartMenu.cpp:490
#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:506
#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:585
#define IDM_SETTINGS
Definition: CStartMenu.cpp:43
HRESULT WINAPI RSHELL_CStartMenu_CreateInstance(REFIID riid, void **ppv)
Definition: CStartMenu.cpp:592
static HRESULT GetStartMenuFolder(IShellFolder **ppsfStartMenu)
Definition: CStartMenu.cpp:580
#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 FIXME(fmt,...)
Definition: debug.h:114
#define WARN(fmt,...)
Definition: debug.h:115
#define ERR(fmt,...)
Definition: debug.h:113
BOOL GetAdvancedValue(LPCWSTR pszName, BOOL bDefault=FALSE) const
Definition: CStartMenu.cpp:190
HRESULT OnGetObject(LPSMDATA psmd, REFIID iid, void **pv)
Definition: CStartMenu.cpp:389
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:454
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:461
HRESULT OnExec(LPSMDATA psmd)
Definition: CStartMenu.cpp:399
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
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3260
HRESULT WINAPI SHGetFolderLocation(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3150
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:3092
HRESULT WINAPI IUnknown_GetSite(LPUNKNOWN lpUnknown, REFIID iid, PVOID *lppSite)
Definition: ordinal.c:2638
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1332
BOOL WINAPI SHRegGetBoolUSValueW(LPCWSTR pszSubKey, LPCWSTR pszValue, BOOL fIgnoreHKCU, BOOL fDefault)
Definition: reg.c:770
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:838
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
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:940
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1350
#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:415
#define SHGFI_DISPLAYNAME
Definition: shellapi.h:166
#define SHGFI_PIDL
Definition: shellapi.h:180
#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:2486
HRESULT hr
Definition: shlfolder.c:183
#define CSIDL_RECENT
Definition: shlobj.h:2174
#define CSIDL_MYDOCUMENTS
Definition: shlobj.h:2178
#define CSIDL_COMMON_STARTMENU
Definition: shlobj.h:2187
#define CSIDL_PERSONAL
Definition: shlobj.h:2171
#define CSIDL_FAVORITES
Definition: shlobj.h:2172
#define CSIDL_COMMON_PROGRAMS
Definition: shlobj.h:2188
#define CSIDL_MYPICTURES
Definition: shlobj.h:2204
#define CSIDL_PRINTERS
Definition: shlobj.h:2170
#define CSIDL_NETWORK
Definition: shlobj.h:2183
#define CSIDL_STARTMENU
Definition: shlobj.h:2177
#define CSIDL_PROGRAMS
Definition: shlobj.h:2168
@ REST_NOSMMYPICS
Definition: shlobj.h:1751
@ REST_NOSMMYDOCS
Definition: shlobj.h:1749
#define CSIDL_CONTROLS
Definition: shlobj.h:2169
#define StrRetToBuf
Definition: shlwapi.h:1769
@ SMIM_TYPE
Definition: shobjidl.idl:2738
@ SMIM_ICON
Definition: shobjidl.idl:2740
@ SMIM_FLAGS
Definition: shobjidl.idl:2739
@ SMIT_STRING
Definition: shobjidl.idl:2746
@ SMIT_SEPARATOR
Definition: shobjidl.idl:2745
@ SMIF_ICON
Definition: shobjidl.idl:2751
@ SMIF_TRACKPOPUP
Definition: shobjidl.idl:2759
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:146
#define IDM_MYPICTURES
Definition: shresdef.h:883
#define IDI_SHELL_MY_DOCUMENTS
Definition: shresdef.h:685
#define IDI_SHELL_SEARCH1
Definition: shresdef.h:769
#define IDI_SHELL_FAVOTITES
Definition: shresdef.h:768
#define IDI_SHELL_MY_PICTURES
Definition: shresdef.h:686
#define IDI_SHELL_TSKBAR_STARTMENU
Definition: shresdef.h:595
#define IDM_MYDOCUMENTS
Definition: shresdef.h:882
#define IDI_SHELL_PRINTER2
Definition: shresdef.h:614
#define IDI_SHELL_PROGRAMS_FOLDER1
Definition: shresdef.h:772
#define IDI_SHELL_CONTROL_PANEL1
Definition: shresdef.h:776
#define IDI_SHELL_LOGOFF1
Definition: shresdef.h:771
#define IDI_SHELL_RECENT_DOCUMENTS1
Definition: shresdef.h:773
#define IDI_SHELL_SHUTDOWN1
Definition: shresdef.h:775
#define IDI_SHELL_NETWORK_CONNECTIONS2
Definition: shresdef.h:707
#define IDI_SHELL_HELP2
Definition: shresdef.h:770
#define IDI_SHELL_CONTROL_PANEL
Definition: shresdef.h:577
#define IDI_SHELL_RUN1
Definition: shresdef.h:774
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:375
LPWSTR dwTypeData
Definition: winuser.h:3269
PUITEMID_CHILD pidlItem
Definition: shobjidl.idl:2710
HMENU hmenu
Definition: shobjidl.idl:2703
IShellFolder * psf
Definition: shobjidl.idl:2711
DWORD dwType
Definition: shobjidl.idl:2722
DWORD dwMask
Definition: shobjidl.idl:2721
DWORD dwFlags
Definition: shobjidl.idl:2723
int32_t INT
Definition: typedefs.h:58
#define SMC_EXEC
Definition: undocshell.h:724
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:770
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:1740
BOOL WINAPI SetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
#define MIIM_SUBMENU
Definition: winuser.h:723
#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
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185