ReactOS 0.4.15-dev-8219-ge8b88cf
shellmenu.h File Reference
#include <stdio.h>
#include <tchar.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <wingdi.h>
#include <winnls.h>
#include <wincon.h>
#include <shellapi.h>
#include <shlobj.h>
#include <shlobj_undoc.h>
#include <shlwapi.h>
#include <shlguid_undoc.h>
#include <uxtheme.h>
#include <strsafe.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <undocshell.h>
#include <undocuser.h>
#include <shellutils.h>
#include <ui/rosctrls.h>
#include "../shresdef.h"
#include <wine/debug.h>
Include dependency graph for shellmenu.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define COBJMACROS
 
#define DEBUG_CCOMOBJECT_CREATION   1
 
#define DEBUG_CCOMOBJECT_DESTRUCTION   1
 
#define DEBUG_CCOMOBJECT_REFCOUNTING   1
 
#define USE_SYSTEM_MENUDESKBAR   0
 
#define USE_SYSTEM_MENUSITE   0
 
#define USE_SYSTEM_MENUBAND   0
 
#define USE_SYSTEM_MERGED_FOLDERS   0
 
#define MERGE_FOLDERS   1
 
#define CMenuDeskBar_CreateInstance   RSHELL_CMenuDeskBar_CreateInstance
 
#define CMenuBand_CreateInstance   RSHELL_CMenuBand_CreateInstance
 
#define CMenuSite_CreateInstance   RSHELL_CMenuSite_CreateInstance
 
#define CMergedFolder_CreateInstance   RSHELL_CMergedFolder_CreateInstance
 

Functions

HRESULT WINAPI RSHELL_CStartMenu_CreateInstance (REFIID riid, void **ppv)
 
HRESULT WINAPI RSHELL_CMenuDeskBar_CreateInstance (REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI RSHELL_CMenuSite_CreateInstance (REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI RSHELL_CMenuBand_CreateInstance (REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI RSHELL_CMergedFolder_CreateInstance (REFIID riid, LPVOID *ppv)
 

Variables

HINSTANCE shell32_hInstance
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 24 of file shellmenu.h.

◆ CMenuBand_CreateInstance

#define CMenuBand_CreateInstance   RSHELL_CMenuBand_CreateInstance

Definition at line 81 of file shellmenu.h.

◆ CMenuDeskBar_CreateInstance

#define CMenuDeskBar_CreateInstance   RSHELL_CMenuDeskBar_CreateInstance

Definition at line 75 of file shellmenu.h.

◆ CMenuSite_CreateInstance

#define CMenuSite_CreateInstance   RSHELL_CMenuSite_CreateInstance

Definition at line 87 of file shellmenu.h.

◆ CMergedFolder_CreateInstance

#define CMergedFolder_CreateInstance   RSHELL_CMergedFolder_CreateInstance

Definition at line 93 of file shellmenu.h.

◆ COBJMACROS

#define COBJMACROS

Definition at line 27 of file shellmenu.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 25 of file shellmenu.h.

◆ DEBUG_CCOMOBJECT_CREATION

#define DEBUG_CCOMOBJECT_CREATION   1

Definition at line 30 of file shellmenu.h.

◆ DEBUG_CCOMOBJECT_DESTRUCTION

#define DEBUG_CCOMOBJECT_DESTRUCTION   1

Definition at line 31 of file shellmenu.h.

◆ DEBUG_CCOMOBJECT_REFCOUNTING

#define DEBUG_CCOMOBJECT_REFCOUNTING   1

Definition at line 32 of file shellmenu.h.

◆ MERGE_FOLDERS

#define MERGE_FOLDERS   1

Definition at line 70 of file shellmenu.h.

◆ USE_SYSTEM_MENUBAND

#define USE_SYSTEM_MENUBAND   0

Definition at line 67 of file shellmenu.h.

◆ USE_SYSTEM_MENUDESKBAR

#define USE_SYSTEM_MENUDESKBAR   0

Definition at line 65 of file shellmenu.h.

◆ USE_SYSTEM_MENUSITE

#define USE_SYSTEM_MENUSITE   0

Definition at line 66 of file shellmenu.h.

◆ USE_SYSTEM_MERGED_FOLDERS

#define USE_SYSTEM_MERGED_FOLDERS   0

Definition at line 68 of file shellmenu.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 23 of file shellmenu.h.

Function Documentation

◆ RSHELL_CMenuBand_CreateInstance()

HRESULT WINAPI RSHELL_CMenuBand_CreateInstance ( REFIID  riid,
LPVOID ppv 
)

Definition at line 1320 of file CMenuBand.cpp.

1321{
1322 return ShellObjectCreator<CMenuBand>(riid, ppv);
1323}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ RSHELL_CMenuDeskBar_CreateInstance()

HRESULT WINAPI RSHELL_CMenuDeskBar_CreateInstance ( REFIID  riid,
LPVOID ppv 
)

Definition at line 855 of file CMenuDeskBar.cpp.

856{
857 return ShellObjectCreator<CMenuDeskBar>(riid, ppv);
858}

◆ RSHELL_CMenuSite_CreateInstance()

HRESULT WINAPI RSHELL_CMenuSite_CreateInstance ( REFIID  riid,
LPVOID ppv 
)

Definition at line 360 of file CMenuSite.cpp.

361{
362 return ShellObjectCreator<CMenuSite>(riid, ppv);
363}

◆ RSHELL_CMergedFolder_CreateInstance()

HRESULT WINAPI RSHELL_CMergedFolder_CreateInstance ( REFIID  riid,
LPVOID ppv 
)

Definition at line 813 of file CMergedFolder.cpp.

814{
815 return ShellObjectCreator<CMergedFolder>(riid, ppv);
816}

◆ RSHELL_CStartMenu_CreateInstance()

HRESULT WINAPI RSHELL_CStartMenu_CreateInstance ( REFIID  riid,
void **  ppv 
)

Definition at line 592 of file CStartMenu.cpp.

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}
static HRESULT GetProgramsFolder(IShellFolder **ppsfStartMenu)
Definition: CStartMenu.cpp:585
static HRESULT GetStartMenuFolder(IShellFolder **ppsfStartMenu)
Definition: CStartMenu.cpp:580
#define WARN(fmt,...)
Definition: debug.h:115
#define NULL
Definition: types.h:112
#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
FxPnpStateCallbackInfo * pCallback
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 QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
unsigned int UINT
Definition: ndis.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
const WCHAR * str
#define CMenuSite_CreateInstance
Definition: shellmenu.h:87
#define CMenuDeskBar_CreateInstance
Definition: shellmenu.h:75
#define CMenuBand_CreateInstance
Definition: shellmenu.h:81
HRESULT hr
Definition: shlfolder.c:183
#define CSIDL_COMMON_PROGRAMS
Definition: shlobj.h:2188
#define CSIDL_PROGRAMS
Definition: shlobj.h:2168
#define StrRetToBuf
Definition: shlwapi.h:1769
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define _countof(array)
Definition: sndvol32.h:70
#define IID_PPV_ARG(Itype, ppType)
char TCHAR
Definition: xmlstorage.h:189

Variable Documentation

◆ shell32_hInstance

HINSTANCE shell32_hInstance
extern

Definition at line 82 of file misc.cpp.

Referenced by if(), and RegisterComponent().