ReactOS 0.4.16-dev-1142-g8029339
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 1324 of file CMenuBand.cpp.

1325{
1326 return ShellObjectCreator<CMenuBand>(riid, ppv);
1327}
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 363 of file CMenuSite.cpp.

364{
365 return ShellObjectCreator<CMenuSite>(riid, ppv);
366}

◆ 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 589 of file CStartMenu.cpp.

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}
static HRESULT GetProgramsFolder(IShellFolder **ppsfStartMenu)
Definition: CStartMenu.cpp:582
static HRESULT GetStartMenuFolder(IShellFolder **ppsfStartMenu)
Definition: CStartMenu.cpp:577
#define WARN(fmt,...)
Definition: precomp.h:61
#define NULL
Definition: types.h:112
#define MAX_PATH
Definition: compat.h:34
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:68
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3384
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:1044
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1497
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:2203
#define CSIDL_PROGRAMS
Definition: shlobj.h:2183
#define StrRetToBuf
Definition: shlwapi.h:1804
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 63 of file misc.cpp.

Referenced by if(), and RegisterComponent().