ReactOS 0.4.15-dev-8116-gf69e256
precomp.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 <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <atlstr.h>
#include <atlcoll.h>
#include <atlsimpcoll.h>
#include <shellapi.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <uxtheme.h>
#include <process.h>
#include <strsafe.h>
#include <undocuser.h>
#include <shlwapi_undoc.h>
#include <shlobj_undoc.h>
#include <shlguid_undoc.h>
#include <undocshell.h>
#include <ui/rosctrls.h>
#include <ui/rosdlgs.h>
#include <shellutils.h>
#include "tmschema.h"
#include "resource.h"
#include <wine/debug.h>
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _TW_STUCKRECTS2
 
struct  TaskbarSettings
 

Macros

#define WIN7_COMPAT_MODE   0
 
#define WIN7_DEBUG_MODE   0
 
#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define COBJMACROS
 
#define OEMRESOURCE
 
#define ASSERT(cond)
 
#define TWM_GETTASKSWITCH   (WM_USER + 236)
 
#define TWM_OPENSTARTMENU   (WM_USER + 260)
 
#define TWM_SETTINGSCHANGED   (WM_USER + 300)
 
#define TWM_PULSE   (WM_USER + 400)
 
#define INTERFACE   ITrayWindow
 
#define ITrayWindow_QueryInterface(p, a, b)   (p)->lpVtbl->QueryInterface(p,a,b)
 
#define ITrayWindow_AddRef(p)   (p)->lpVtbl->AddRef(p)
 
#define ITrayWindow_Release(p)   (p)->lpVtbl->Release(p)
 
#define ITrayWindow_Open(p)   (p)->lpVtbl->Open(p)
 
#define ITrayWindow_Close(p)   (p)->lpVtbl->Close(p)
 
#define ITrayWindow_GetHWND(p)   (p)->lpVtbl->GetHWND(p)
 
#define ITrayWindow_IsSpecialHWND(p, a)   (p)->lpVtbl->IsSpecialHWND(p,a)
 
#define ITrayWindow_IsHorizontal(p)   (p)->lpVtbl->IsHorizontal(p)
 
#define ITrayWindow_DisplayProperties(p)   (p)->lpVtbl->DisplayProperties(p)
 
#define ITrayWindow_ExecContextMenuCmd(p, a)   (p)->lpVtbl->ExecContextMenuCmd(p,a)
 
#define ITrayWindow_Lock(p, a)   (p)->lpVtbl->Lock(p,a)
 
#define ITrayWindow_IsTaskWnd(p, a)   (p)->lpVtbl->IsTaskWnd(p,a)
 
#define INTERFACE   ITrayBandSite
 
#define ITrayBandSite_QueryInterface(p, a, b)   (p)->lpVtbl->QueryInterface(p,a,b)
 
#define ITrayBandSite_AddRef(p)   (p)->lpVtbl->AddRef(p)
 
#define ITrayBandSite_Release(p)   (p)->lpVtbl->Release(p)
 
#define ITrayBandSite_OnLoad(p, a, b, c)   (p)->lpVtbl->OnLoad(p,a,b,c)
 
#define ITrayBandSite_OnSave(p, a, b)   (p)->lpVtbl->OnSave(p,a,b)
 
#define ITrayBandSite_IsTaskBand(p, a)   (p)->lpVtbl->IsTaskBand(p,a)
 
#define ITrayBandSite_ProcessMessage(p, a, b, c, d, e)   (p)->lpVtbl->ProcessMessage(p,a,b,c,d,e)
 
#define ITrayBandSite_AddContextMenus(p, a, b, c, d, e, f)   (p)->lpVtbl->AddContextMenus(p,a,b,c,d,e,f)
 
#define ITrayBandSite_Lock(p, a)   (p)->lpVtbl->Lock(p,a)
 
#define TNWM_GETMINIMUMSIZE   (WM_USER + 0x100)
 
#define TNWM_CHANGETRAYPOS   (WM_USER + 0x104)
 
#define NTNWM_REALIGN   (0x1)
 
#define TSWM_UPDATETASKBARPOS   (WM_USER + 2)
 

Typedefs

typedef struct _TW_STUCKRECTS2 TW_STRUCKRECTS2
 
typedef struct _TW_STUCKRECTS2PTW_STUCKRECTS2
 

Enumerations

enum  TrayIconsMode { TIM_Default , TIM_NeverCompact , TIM_AlwaysCompact , TIM_Max = TIM_AlwaysCompact }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (explorernew)
 
static LONG SetWindowStyle (IN HWND hWnd, IN LONG dwStyleMask, IN LONG dwStyle)
 
static LONG SetWindowExStyle (IN HWND hWnd, IN LONG dwStyleMask, IN LONG dwStyle)
 
HMENU LoadPopupMenu (IN HINSTANCE hInstance, IN LPCWSTR lpMenuName)
 
HMENU FindSubMenu (IN HMENU hMenu, IN UINT uItem, IN BOOL fByPosition)
 
BOOL GetCurrentLoggedOnUserName (OUT LPWSTR szBuffer, IN DWORD dwBufferSize)
 
BOOL FormatMenuString (IN HMENU hMenu, IN UINT uPosition, IN UINT uFlags,...)
 
BOOL GetRegValue (IN LPCWSTR pszSubKey, IN LPCWSTR pszValueName, IN BOOL bDefaultValue)
 
BOOL SetRegDword (IN LPCWSTR pszSubKey, IN LPCWSTR pszValueName, IN DWORD dwValue)
 
BOOL GetAdvancedBool (IN LPCWSTR pszValueName, IN BOOL bDefaultValue)
 
BOOL SetAdvancedDword (IN LPCWSTR pszValueName, IN DWORD dwValue)
 
VOID InitRSHELL (VOID)
 
HRESULT WINAPI _CStartMenu_CreateInstance (REFIID riid, void **ppv)
 
HANDLE WINAPI _SHCreateDesktop (IShellDesktopTray *ShellDesk)
 
BOOL WINAPI _SHDesktopMessageLoop (HANDLE hDesktop)
 
DWORD WINAPI _WinList_Init (void)
 
void WINAPI _ShellDDEInit (BOOL bInit)
 
HRESULT WINAPI _CBandSiteMenu_CreateInstance (REFIID riid, void **ppv)
 
HRESULT WINAPI _CBandSite_CreateInstance (LPUNKNOWN pUnkOuter, REFIID riid, void **ppv)
 
 DECLARE_INTERFACE_ (ITrayWindow, IUnknown)
 
HRESULT CreateTrayWindow (ITrayWindow **ppTray)
 
VOID TrayProcessMessages (IN OUT ITrayWindow *Tray)
 
VOID TrayMessageLoop (IN OUT ITrayWindow *Tray)
 
HRESULT InitShellServices (HDPA *phdpa)
 
HRESULT ShutdownShellServices (HDPA hdpa)
 
BOOL DoStartStartupItems (ITrayWindow *Tray)
 
INT ProcessStartupItems (VOID)
 
BOOL DoFinishStartupItems (VOID)
 
VOID DisplayTrayProperties (IN HWND hwndOwner, IN HWND hwndTaskbar)
 
HANDLE DesktopCreateWindow (IN OUT ITrayWindow *Tray)
 
VOID DesktopDestroyShellWindow (IN HANDLE hDesktop)
 
VOID ShowCustomizeNotifyIcons (HINSTANCE, HWND)
 
HRESULT CTaskBand_CreateInstance (IN ITrayWindow *Tray, HWND hWndStartButton, REFIID riid, void **ppv)
 
 DECLARE_INTERFACE_ (ITrayBandSite, IUnknown)
 
HRESULT CTrayBandSite_CreateInstance (IN ITrayWindow *tray, IN IDeskBand *pTaskBand, OUT ITrayBandSite **pBandSite)
 
HRESULT CStartMenuBtnCtxMenu_CreateInstance (ITrayWindow *TrayWnd, IN HWND hWndOwner, IContextMenu **ppCtxMenu)
 
IMenuPopupCreateStartMenu (IN ITrayWindow *Tray, OUT IMenuBand **ppMenuBand, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons)
 
HRESULT UpdateStartMenu (IN OUT IMenuPopup *pMenuPopup, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons, IN BOOL bRefresh)
 
VOID ShowCustomizeClassic (HINSTANCE, HWND)
 
HRESULT CStartMenuSite_CreateInstance (IN OUT ITrayWindow *Tray, const IID &riid, PVOID *ppv)
 
HRESULT CTrayClockWnd_CreateInstance (HWND hwndParent, REFIID riid, void **ppv)
 
HRESULT CTrayNotifyWnd_CreateInstance (HWND hwndParent, REFIID riid, void **ppv)
 
HRESULT CSysPagerWnd_CreateInstance (HWND hwndParent, REFIID riid, void **ppv)
 
HRESULT CTaskSwitchWnd_CreateInstance (IN HWND hWndParent, IN OUT ITrayWindow *Tray, REFIID riid, void **ppv)
 
HRESULT Tray_OnStartMenuDismissed (ITrayWindow *Tray)
 
HRESULT IsSameObject (IN IUnknown *punk1, IN IUnknown *punk2)
 

Variables

HINSTANCE hExplorerInstance
 
HANDLE hProcessHeap
 
HKEY hkExplorer
 
BOOL bExplorerIsShell
 
const GUID IID_IShellDesktopTray
 
TaskbarSettings g_TaskbarSettings
 
const GUID CLSID_ITaskBand
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 16 of file precomp.h.

◆ ASSERT

#define ASSERT (   cond)
Value:
do if (!(cond)) { \
Win32DbgPrint(__FILE__, __LINE__, "ASSERTION %s FAILED!\n", #cond); \
} while (0)

Definition at line 58 of file precomp.h.

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file precomp.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 17 of file precomp.h.

◆ INTERFACE [1/2]

#define INTERFACE   ITrayWindow

Definition at line 293 of file precomp.h.

◆ INTERFACE [2/2]

#define INTERFACE   ITrayBandSite

Definition at line 293 of file precomp.h.

◆ ITrayBandSite_AddContextMenus

#define ITrayBandSite_AddContextMenus (   p,
  a,
  b,
  c,
  d,
  e,
  f 
)    (p)->lpVtbl->AddContextMenus(p,a,b,c,d,e,f)

Definition at line 322 of file precomp.h.

◆ ITrayBandSite_AddRef

#define ITrayBandSite_AddRef (   p)    (p)->lpVtbl->AddRef(p)

Definition at line 314 of file precomp.h.

◆ ITrayBandSite_IsTaskBand

#define ITrayBandSite_IsTaskBand (   p,
  a 
)    (p)->lpVtbl->IsTaskBand(p,a)

Definition at line 320 of file precomp.h.

◆ ITrayBandSite_Lock

#define ITrayBandSite_Lock (   p,
  a 
)    (p)->lpVtbl->Lock(p,a)

Definition at line 323 of file precomp.h.

◆ ITrayBandSite_OnLoad

#define ITrayBandSite_OnLoad (   p,
  a,
  b,
  c 
)    (p)->lpVtbl->OnLoad(p,a,b,c)

Definition at line 317 of file precomp.h.

◆ ITrayBandSite_OnSave

#define ITrayBandSite_OnSave (   p,
  a,
  b 
)    (p)->lpVtbl->OnSave(p,a,b)

Definition at line 318 of file precomp.h.

◆ ITrayBandSite_ProcessMessage

#define ITrayBandSite_ProcessMessage (   p,
  a,
  b,
  c,
  d,
  e 
)    (p)->lpVtbl->ProcessMessage(p,a,b,c,d,e)

Definition at line 321 of file precomp.h.

◆ ITrayBandSite_QueryInterface

#define ITrayBandSite_QueryInterface (   p,
  a,
  b 
)    (p)->lpVtbl->QueryInterface(p,a,b)

Definition at line 313 of file precomp.h.

◆ ITrayBandSite_Release

#define ITrayBandSite_Release (   p)    (p)->lpVtbl->Release(p)

Definition at line 315 of file precomp.h.

◆ ITrayWindow_AddRef

#define ITrayWindow_AddRef (   p)    (p)->lpVtbl->AddRef(p)

Definition at line 161 of file precomp.h.

◆ ITrayWindow_Close

#define ITrayWindow_Close (   p)    (p)->lpVtbl->Close(p)

Definition at line 165 of file precomp.h.

◆ ITrayWindow_DisplayProperties

#define ITrayWindow_DisplayProperties (   p)    (p)->lpVtbl->DisplayProperties(p)

Definition at line 169 of file precomp.h.

◆ ITrayWindow_ExecContextMenuCmd

#define ITrayWindow_ExecContextMenuCmd (   p,
  a 
)    (p)->lpVtbl->ExecContextMenuCmd(p,a)

Definition at line 170 of file precomp.h.

◆ ITrayWindow_GetHWND

#define ITrayWindow_GetHWND (   p)    (p)->lpVtbl->GetHWND(p)

Definition at line 166 of file precomp.h.

◆ ITrayWindow_IsHorizontal

#define ITrayWindow_IsHorizontal (   p)    (p)->lpVtbl->IsHorizontal(p)

Definition at line 168 of file precomp.h.

◆ ITrayWindow_IsSpecialHWND

#define ITrayWindow_IsSpecialHWND (   p,
  a 
)    (p)->lpVtbl->IsSpecialHWND(p,a)

Definition at line 167 of file precomp.h.

◆ ITrayWindow_IsTaskWnd

#define ITrayWindow_IsTaskWnd (   p,
  a 
)    (p)->lpVtbl->IsTaskWnd(p,a)

Definition at line 172 of file precomp.h.

◆ ITrayWindow_Lock

#define ITrayWindow_Lock (   p,
  a 
)    (p)->lpVtbl->Lock(p,a)

Definition at line 171 of file precomp.h.

◆ ITrayWindow_Open

#define ITrayWindow_Open (   p)    (p)->lpVtbl->Open(p)

Definition at line 164 of file precomp.h.

◆ ITrayWindow_QueryInterface

#define ITrayWindow_QueryInterface (   p,
  a,
  b 
)    (p)->lpVtbl->QueryInterface(p,a,b)

Definition at line 160 of file precomp.h.

◆ ITrayWindow_Release

#define ITrayWindow_Release (   p)    (p)->lpVtbl->Release(p)

Definition at line 162 of file precomp.h.

◆ NTNWM_REALIGN

#define NTNWM_REALIGN   (0x1)

Definition at line 370 of file precomp.h.

◆ OEMRESOURCE

#define OEMRESOURCE

Definition at line 20 of file precomp.h.

◆ TNWM_CHANGETRAYPOS

#define TNWM_CHANGETRAYPOS   (WM_USER + 0x104)

Definition at line 368 of file precomp.h.

◆ TNWM_GETMINIMUMSIZE

#define TNWM_GETMINIMUMSIZE   (WM_USER + 0x100)

Definition at line 367 of file precomp.h.

◆ TSWM_UPDATETASKBARPOS

#define TSWM_UPDATETASKBARPOS   (WM_USER + 2)

Definition at line 381 of file precomp.h.

◆ TWM_GETTASKSWITCH

#define TWM_GETTASKSWITCH   (WM_USER + 236)

Definition at line 131 of file precomp.h.

◆ TWM_OPENSTARTMENU

#define TWM_OPENSTARTMENU   (WM_USER + 260)

Definition at line 132 of file precomp.h.

◆ TWM_PULSE

#define TWM_PULSE   (WM_USER + 400)

Definition at line 134 of file precomp.h.

◆ TWM_SETTINGSCHANGED

#define TWM_SETTINGSCHANGED   (WM_USER + 300)

Definition at line 133 of file precomp.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 15 of file precomp.h.

◆ WIN7_COMPAT_MODE

#define WIN7_COMPAT_MODE   0

Definition at line 4 of file precomp.h.

◆ WIN7_DEBUG_MODE

#define WIN7_DEBUG_MODE   0

Definition at line 5 of file precomp.h.

Typedef Documentation

◆ PTW_STUCKRECTS2

◆ TW_STRUCKRECTS2

Enumeration Type Documentation

◆ TrayIconsMode

Enumerator
TIM_Default 
TIM_NeverCompact 
TIM_AlwaysCompact 
TIM_Max 

Definition at line 187 of file precomp.h.

188{
193};
@ TIM_AlwaysCompact
Definition: precomp.h:191
@ TIM_NeverCompact
Definition: precomp.h:190
@ TIM_Max
Definition: precomp.h:192
@ TIM_Default
Definition: precomp.h:189

Function Documentation

◆ _CBandSite_CreateInstance()

HRESULT WINAPI _CBandSite_CreateInstance ( LPUNKNOWN  pUnkOuter,
REFIID  riid,
void **  ppv 
)

Definition at line 186 of file rshell.cpp.

187{
188 if (ghRShell)
189 {
191 if (func)
192 {
193 return func(pUnkOuter, riid, ppv);
194 }
195 }
196
197 return CoCreateInstance(CLSID_RebarBandSite,
198 pUnkOuter,
199 CLSCTX_INPROC_SERVER,
200 riid,
201 ppv);
202}
#define GetProcAddress(x, y)
Definition: compat.h:753
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
GLenum func
Definition: glext.h:6028
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HINSTANCE ghRShell
Definition: rshell.cpp:23
HRESULT(WINAPI * CBANDSITE_CREATEINSTANCE)(LPUNKNOWN pUnkOuter, REFIID riid, void **ppv)
Definition: rshell.cpp:185

Referenced by CTrayBandSite::_Init().

◆ _CBandSiteMenu_CreateInstance()

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

Definition at line 167 of file rshell.cpp.

168{
169 if (ghRShell)
170 {
172 if (func)
173 {
174 return func(riid, ppv);
175 }
176 }
177
178 return CoCreateInstance(CLSID_BandSiteMenu,
179 NULL,
180 CLSCTX_INPROC_SERVER,
181 riid,
182 ppv);
183}
#define NULL
Definition: types.h:112
HRESULT(WINAPI * CBANDSITEMENU_CREATEINSTANCE)(REFIID riid, void **ppv)
Definition: rshell.cpp:166

Referenced by CTrayBandSite::AddContextMenus().

◆ _CStartMenu_CreateInstance()

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

Definition at line 32 of file rshell.cpp.

33{
34 if (ghRShell)
35 {
37 if (func)
38 {
39 return func(riid, ppv);
40 }
41 }
42
44 NULL,
45 CLSCTX_INPROC_SERVER,
46 riid,
47 ppv);
48}
const GUID CLSID_StartMenu
HRESULT(WINAPI * PSTARTMENU_CREATEINSTANCE)(REFIID riid, void **ppv)
Definition: rshell.cpp:25

Referenced by CreateStartMenu().

◆ _SHCreateDesktop()

HANDLE WINAPI _SHCreateDesktop ( IShellDesktopTray *  ShellDesk)

Definition at line 52 of file rshell.cpp.

53{
54 HINSTANCE hFallback;
55
56 if (ghRShell)
57 {
59 if (func)
60 {
61 return func(ShellDesk);
62 }
63 }
64
65 hFallback = GetModuleHandleW(L"shell32.dll");
66
67 if (hFallback)
68 {
70 if (func)
71 {
72 return func(ShellDesk);
73 }
74 }
75
76 return 0;
77}
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define L(x)
Definition: ntvdm.h:50
HANDLE(WINAPI * PSHCREATEDESKTOP)(IShellDesktopTray *ShellDesk)
Definition: rshell.cpp:50
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by CDesktopThread::DesktopThreadProc().

◆ _SHDesktopMessageLoop()

BOOL WINAPI _SHDesktopMessageLoop ( HANDLE  hDesktop)

Definition at line 81 of file rshell.cpp.

82{
83 HINSTANCE hFallback;
84
85 if (ghRShell)
86 {
88 if (func)
89 {
90 return func(hDesktop);
91 }
92 }
93
94 hFallback = GetModuleHandleW(L"shell32.dll");
95
96 if (hFallback)
97 {
99 if (func)
100 {
101 return func(hDesktop);
102 }
103 }
104
105 return FALSE;
106}
#define FALSE
Definition: types.h:117
BOOL(WINAPI * PSHDESKTOPMESSAGELOOP)(HANDLE hDesktop)
Definition: rshell.cpp:79

Referenced by CDesktopThread::DesktopThreadProc().

◆ _ShellDDEInit()

void WINAPI _ShellDDEInit ( BOOL  bInit)

Definition at line 139 of file rshell.cpp.

140{
141 HINSTANCE hFallback;
142
143 if (ghRShell)
144 {
146 if (func)
147 {
148 func(bInit);
149 return;
150 }
151 }
152
153 hFallback = GetModuleHandleW(L"shell32.dll");
154
155 if (hFallback)
156 {
158 if (func)
159 {
160 func(bInit);
161 return;
162 }
163 }
164}
void(WINAPI * PSHELLDDEINIT)(BOOL bInit)
Definition: rshell.cpp:137

Referenced by StartWithDesktop().

◆ _WinList_Init()

DWORD WINAPI _WinList_Init ( void  )

Definition at line 110 of file rshell.cpp.

111{
112 HINSTANCE hFallback;
113
114 if (ghRShell)
115 {
117 if (func)
118 {
119 return func();
120 }
121 }
122
123 hFallback = LoadLibraryW(L"shdocvw.dll");
124
125 if (hFallback)
126 {
128 if (func)
129 {
130 return func();
131 }
132 }
133
134 return 0;
135}
#define LoadLibraryW(x)
Definition: compat.h:747
DWORD(WINAPI * PWINLIST_INIT)(void)
Definition: rshell.cpp:108

Referenced by StartWithDesktop().

◆ CreateStartMenu()

IMenuPopup * CreateStartMenu ( IN ITrayWindow *  Tray,
OUT IMenuBand **  ppMenuBand,
IN HBITMAP hbmBanner  OPTIONAL,
IN BOOL  bSmallIcons 
)

Definition at line 50 of file startmnu.cpp.

54{
55 HRESULT hr;
62 DWORD dwBandId = 0;
63
66 return NULL;
67
70 return NULL;
71
72 /* Set the menu site so we can handle messages */
73 hr = IUnknown_SetSite(pMp, pSms);
75 return NULL;
76
77 /* Initialize the menu object */
78 hr = pMp->QueryInterface(IID_PPV_ARG(IInitializeObject, &pIo));
79 if (SUCCEEDED(hr))
80 hr = pIo->Initialize();
81 else
82 hr = S_OK;
83
84 /* Everything is initialized now. Let's get the IMenuBand interface. */
86 return NULL;
87
88 hr = pMp->GetClient(&pUnk);
90 return NULL;
91
94 return NULL;
95
96 /* Finally we have the IBandSite interface, there's only one
97 band in it that apparently provides the IMenuBand interface */
98 hr = pBs->EnumBands(0, &dwBandId);
100 return NULL;
101
102 hr = pBs->GetBandObject(dwBandId, IID_PPV_ARG(IMenuBand, &pMb));
104 return NULL;
105
106 UpdateStartMenu(pMp, hbmBanner, bSmallIcons, FALSE);
107
108 *ppMenuBand = pMb.Detach();
109
110 return pMp.Detach();
111}
HRESULT CStartMenuSite_CreateInstance(IN OUT ITrayWindow *Tray, const IID &riid, PVOID *ppv)
HRESULT WINAPI _CStartMenu_CreateInstance(REFIID riid, void **ppv)
Definition: rshell.cpp:32
T * Detach()
Definition: atlcomcli.h:186
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT WINAPI IUnknown_SetSite(IUnknown *obj, IUnknown *site)
Definition: ordinal.c:1407
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
unsigned long DWORD
Definition: ntddk_ex.h:95
nsresult QueryInterface(nsIIDRef riid, void **result)
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hr
Definition: shlfolder.c:183
HRESULT UpdateStartMenu(IN OUT IMenuPopup *pMenuPopup, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons, IN BOOL bRefresh)
Definition: startmnu.cpp:24
#define IID_PPV_ARG(Itype, ppType)

Referenced by CTrayWindow::OnCreate(), and CTrayWindow::OnSettingChanged().

◆ CreateTrayWindow()

HRESULT CreateTrayWindow ( ITrayWindow **  ppTray)

Definition at line 3877 of file traywnd.cpp.

3878{
3880 if (Tray == NULL)
3881 return E_OUTOFMEMORY;
3882
3883 Tray->_Init();
3884 Tray->Open();
3885
3886 *ppTray = (ITrayWindow *) Tray;
3887
3888 return S_OK;
3889}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100

Referenced by StartWithDesktop().

◆ CStartMenuBtnCtxMenu_CreateInstance()

HRESULT CStartMenuBtnCtxMenu_CreateInstance ( ITrayWindow *  TrayWnd,
IN HWND  hWndOwner,
IContextMenu **  ppCtxMenu 
)

Definition at line 249 of file startctxmnu.cpp.

250{
251 return ShellObjectCreatorInit<CStartMenuBtnCtxMenu>(m_TrayWnd, m_Owner, IID_PPV_ARG(IContextMenu, ppCtxMenu));
252}

Referenced by CTrayWindow::OnContextMenu().

◆ CStartMenuSite_CreateInstance()

HRESULT CStartMenuSite_CreateInstance ( IN OUT ITrayWindow *  Tray,
const IID riid,
PVOID ppv 
)

Definition at line 358 of file startmnusite.cpp.

359{
360 return ShellObjectCreatorInit<CStartMenuSite>(Tray, riid, ppv);
361}

Referenced by CreateStartMenu().

◆ CSysPagerWnd_CreateInstance()

HRESULT CSysPagerWnd_CreateInstance ( HWND  hwndParent,
REFIID  riid,
void **  ppv 
)

Definition at line 1611 of file syspager.cpp.

1612{
1613 return ShellObjectCreatorInit<CSysPagerWnd>(hwndParent, riid, ppv);
1614}
static HWND hwndParent
Definition: cryptui.c:300

Referenced by CTrayNotifyWnd::OnCreate().

◆ CTaskBand_CreateInstance()

HRESULT CTaskBand_CreateInstance ( IN ITrayWindow *  Tray,
HWND  hWndStartButton,
REFIID  riid,
void **  ppv 
)

Definition at line 346 of file taskband.cpp.

347{
348 return ShellObjectCreatorInit<CTaskBand>(Tray, hWndStartButton, riid, ppv);
349}

Referenced by CTrayWindow::OnCreate().

◆ CTaskSwitchWnd_CreateInstance()

HRESULT CTaskSwitchWnd_CreateInstance ( IN HWND  hWndParent,
IN OUT ITrayWindow *  Tray,
REFIID  riid,
void **  ppv 
)

Definition at line 2026 of file taskswnd.cpp.

2027{
2028 return ShellObjectCreatorInit<CTaskSwitchWnd>(hWndParent, Tray, riid, ppv);
2029}

Referenced by CTaskBand::SetSite().

◆ CTrayBandSite_CreateInstance()

HRESULT CTrayBandSite_CreateInstance ( IN ITrayWindow *  tray,
IN IDeskBand pTaskBand,
OUT ITrayBandSite **  pBandSite 
)

Definition at line 715 of file tbsite.cpp.

716{
717 HRESULT hr;
718
720 if (!tb)
721 return E_FAIL;
722
723 tb->AddRef();
724
725 hr = tb->_Init(tray, pTaskBand);
727 {
728 tb->Release();
729 return hr;
730 }
731
732 *pBandSite = tb;
733
734 return S_OK;
735}
#define E_FAIL
Definition: ddrawi.h:102
static const WCHAR tb[]
Definition: suminfo.c:285

Referenced by CTrayWindow::OnCreate().

◆ CTrayClockWnd_CreateInstance()

HRESULT CTrayClockWnd_CreateInstance ( HWND  hwndParent,
REFIID  riid,
void **  ppv 
)

Definition at line 779 of file trayclock.cpp.

780{
781 return ShellObjectCreatorInit<CTrayClockWnd>(hwndParent, riid, ppv);
782}

Referenced by CTrayNotifyWnd::OnCreate().

◆ CTrayNotifyWnd_CreateInstance()

HRESULT CTrayNotifyWnd_CreateInstance ( HWND  hwndParent,
REFIID  riid,
void **  ppv 
)

Definition at line 372 of file trayntfy.cpp.

373{
374 return ShellObjectCreatorInit<CTrayNotifyWnd>(hwndParent, riid, ppv);
375}

Referenced by CTrayWindow::OnCreate().

◆ DECLARE_INTERFACE_() [1/2]

DECLARE_INTERFACE_ ( ITrayBandSite  ,
IUnknown   
)

Definition at line 294 of file precomp.h.

295{
296 /*** IUnknown methods ***/
300 /*** IBandSiteStreamCallback ***/
301 STDMETHOD_(HRESULT, OnLoad)(THIS_ IStream *pStm, REFIID riid, PVOID *pvObj) PURE;
302 STDMETHOD_(HRESULT, OnSave)(THIS_ IUnknown *pUnk, IStream *pStm) PURE;
303 /*** ITrayBandSite methods ***/
304 STDMETHOD_(HRESULT, IsTaskBand) (THIS_ IUnknown *punk) PURE;
305 STDMETHOD_(HRESULT, ProcessMessage) (THIS_ HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult) PURE;
306 STDMETHOD_(HRESULT, AddContextMenus) (THIS_ HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags, IContextMenu **ppcm) PURE;
308};
HWND hWnd
Definition: settings.c:17
#define PURE
Definition: basetyps.h:64
#define THIS_
Definition: basetyps.h:65
#define THIS
Definition: basetyps.h:66
#define STDMETHOD_(t, m)
Definition: basetyps.h:63
_In_ BOOLEAN Release
Definition: cdrom.h:920
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
UINT uFlags
Definition: api.c:59
unsigned int BOOL
Definition: ntddk_ex.h:94
static HRESULT QueryInterface(REFIID, void **)
Definition: events.c:2587
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
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 REFIID
Definition: guiddef.h:118
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
static HMENU hmenu
Definition: win.c:66
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207

◆ DECLARE_INTERFACE_() [2/2]

DECLARE_INTERFACE_ ( ITrayWindow  ,
IUnknown   
)

Definition at line 139 of file precomp.h.

140{
141 /*** IUnknown methods ***/
145 /*** ITrayWindow methods ***/
148 STDMETHOD_(HWND, GetHWND) (THIS) PURE;
149 STDMETHOD_(BOOL, IsSpecialHWND) (THIS_ HWND hWnd) PURE;
150 STDMETHOD_(BOOL, IsHorizontal) (THIS) PURE;
151 STDMETHOD_(HWND, DisplayProperties) (THIS) PURE;
152 STDMETHOD_(BOOL, ExecContextMenuCmd) (THIS_ UINT uiCmd) PURE;
153 STDMETHOD_(BOOL, Lock) (THIS_ BOOL bLock) PURE;
154 STDMETHOD_(BOOL, IsTaskWnd) (THIS_ HWND hWnd) PURE;
155};
#define Open
Definition: syshdrs.h:62
@ Close
Definition: sacdrv.h:268

◆ DesktopCreateWindow()

HANDLE DesktopCreateWindow ( IN OUT ITrayWindow *  Tray)

Definition at line 188 of file desktop.cpp.

189{
190 CDesktopThread* pDesktopThread = new CDesktopThread();
191
192 HRESULT hres = pDesktopThread->Initialize(Tray);
194 {
195 delete pDesktopThread;
196 return NULL;
197 }
198
199 return pDesktopThread;
200}
HRESULT Initialize(ITrayWindow *pTray)
Definition: desktop.cpp:57
HRESULT hres
Definition: protocol.c:465

Referenced by StartWithDesktop().

◆ DesktopDestroyShellWindow()

VOID DesktopDestroyShellWindow ( IN HANDLE  hDesktop)

Definition at line 203 of file desktop.cpp.

204{
205 CDesktopThread* pDesktopThread = reinterpret_cast<CDesktopThread*>(hDesktop);
206 delete pDesktopThread;
207}

Referenced by StartWithDesktop().

◆ DisplayTrayProperties()

VOID DisplayTrayProperties ( IN HWND  hwndOwner,
IN HWND  hwndTaskbar 
)

Definition at line 344 of file trayprop.cpp.

345{
346 PROPSHEETHEADER psh;
348 CTaskBarSettingsPage tbSettingsPage(hwndTaskbar);
349 CStartMenuSettingsPage smSettingsPage;
350 CNotifySettingsPage naSettingsPage(hwndTaskbar);
351 CStringW caption;
352
353 caption.LoadStringW(IDS_TASKBAR_STARTMENU_PROP_CAPTION);
354
355 hpsp.Add(tbSettingsPage.Create());
356 hpsp.Add(smSettingsPage.Create());
357 hpsp.Add(naSettingsPage.Create());
358
359 ZeroMemory(&psh, sizeof(psh));
360 psh.dwSize = sizeof(psh);
362 psh.hwndParent = hwndOwner;
363 psh.hInstance = hExplorerInstance;
364 psh.pszIcon = MAKEINTRESOURCEW(IDI_STARTMENU);
365 psh.pszCaption = caption.GetString();
366 psh.nPages = hpsp.GetSize();
367 psh.nStartPage = 0;
368 psh.phpage = hpsp.GetData();
369 psh.pfnCallback = PropSheetProc;
370
371 PropertySheet(&psh);
372}
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
#define IDI_STARTMENU
Definition: resource.h:14
#define IDS_TASKBAR_STARTMENU_PROP_CAPTION
Definition: resource.h:104
HPROPSHEETPAGE Create()
Definition: rosdlgs.h:57
PXSTR GetString() noexcept
Definition: atlsimpstr.h:367
#define PROPSHEETHEADER
Definition: prsht.h:392
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PropertySheet
Definition: prsht.h:400
#define PSH_USEICONID
Definition: prsht.h:42
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: trayprop.cpp:327
#define ZeroMemory
Definition: winbase.h:1712
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by CTrayWindow::TrayPropertiesThread().

◆ DoFinishStartupItems()

BOOL DoFinishStartupItems ( VOID  )

Definition at line 508 of file startup.cpp.

509{
510 if (s_hStartupMutex)
511 {
515 }
516 return TRUE;
517}
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:739
static HANDLE s_hStartupMutex
Definition: startup.cpp:46
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:618

Referenced by DoStartStartupItems(), and StartWithDesktop().

◆ DoStartStartupItems()

BOOL DoStartStartupItems ( ITrayWindow *  Tray)

Definition at line 519 of file startup.cpp.

520{
521 DWORD dwWait;
522
523 if (!bExplorerIsShell)
524 return FALSE;
525
526 if (!s_hStartupMutex)
527 {
528 // Accidentally, there is possibility that the system starts multiple Explorers
529 // before startup of shell. We use a mutex to match the timing of shell initialization.
530 s_hStartupMutex = CreateMutexW(NULL, FALSE, L"ExplorerIsShellMutex");
531 if (s_hStartupMutex == NULL)
532 return FALSE;
533 }
534
536 TRACE("dwWait: 0x%08lX\n", dwWait);
537 if (dwWait != WAIT_OBJECT_0)
538 {
539 TRACE("LastError: %ld\n", GetLastError());
540
542 return FALSE;
543 }
544
545 const DWORD dwWaitTotal = 3000; // in milliseconds
546 DWORD dwTick = GetTickCount();
547 while (GetShellWindow() == NULL && GetTickCount() - dwTick < dwWaitTotal)
548 {
550 }
551
552 if (GetShellWindow() == NULL)
553 {
555 return FALSE;
556 }
557
558 // Check the volatile "StartupHasBeenRun" key
559 HKEY hSessionKey, hKey;
560 HRESULT hr = SHCreateSessionKey(KEY_WRITE, &hSessionKey);
561 if (SUCCEEDED(hr))
562 {
563 ASSERT(hSessionKey);
564
565 DWORD dwDisp;
566 LONG Error = RegCreateKeyExW(hSessionKey, L"StartupHasBeenRun", 0, NULL,
568 RegCloseKey(hSessionKey);
570 if (Error == ERROR_SUCCESS && dwDisp == REG_OPENED_EXISTING_KEY)
571 {
572 return FALSE; // Startup programs has already been run
573 }
574 }
575
576 return TRUE;
577}
BOOL bExplorerIsShell
Definition: explorer.cpp:27
VOID TrayProcessMessages(IN OUT ITrayWindow *Tray)
BOOL Error
Definition: chkdsk.c:66
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
#define INFINITE
Definition: serial.h:102
FxAutoRegKey hKey
#define ASSERT(a)
Definition: mode.c:44
#define KEY_WRITE
Definition: nt_native.h:1031
#define REG_OPENED_EXISTING_KEY
Definition: nt_native.h:1085
#define REG_OPTION_VOLATILE
Definition: nt_native.h:1060
long LONG
Definition: pedump.c:60
HRESULT WINAPI SHCreateSessionKey(REGSAM samDesired, PHKEY phKey)
Definition: shellreg.c:147
#define TRACE(s)
Definition: solgame.cpp:4
BOOL DoFinishStartupItems(VOID)
Definition: startup.cpp:508
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:576
HWND WINAPI GetShellWindow(VOID)
Definition: desktop.c:651
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define WAIT_OBJECT_0
Definition: winbase.h:406

Referenced by StartWithDesktop().

◆ FindSubMenu()

HMENU FindSubMenu ( IN HMENU  hMenu,
IN UINT  uItem,
IN BOOL  fByPosition 
)

Definition at line 55 of file util.cpp.

58{
59 MENUITEMINFOW mii;
60
61 mii.cbSize = sizeof(mii);
62 mii.fMask = MIIM_SUBMENU;
63
64 if (GetMenuItemInfoW(hMenu, uItem, fByPosition, &mii))
65 {
66 return mii.hSubMenu;
67 }
68
69 return NULL;
70}
#define MIIM_SUBMENU
Definition: winuser.h:723
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)

Referenced by CStartMenuSite::AppendMenu().

◆ FormatMenuString()

BOOL FormatMenuString ( IN HMENU  hMenu,
IN UINT  uPosition,
IN UINT  uFlags,
  ... 
)

Definition at line 106 of file util.cpp.

110{
111 va_list vl;
112 MENUITEMINFOW mii;
113 WCHAR szBuf[128];
114 WCHAR szBufFmt[128];
115
116 /* Find the menu item and read the formatting string */
117 mii.cbSize = sizeof(mii);
118 mii.fMask = MIIM_STRING;
119 mii.dwTypeData = szBufFmt;
120 mii.cch = _countof(szBufFmt);
121 if (GetMenuItemInfoW(hMenu, uPosition, uFlags, &mii))
122 {
123 /* Format the string */
124 va_start(vl, uFlags);
125 _vsntprintf(szBuf,
126 _countof(szBuf) - 1,
127 szBufFmt,
128 vl);
129 va_end(vl);
130 szBuf[_countof(szBuf) - 1] = L'\0';
131
132 /* Update the menu item */
133 mii.dwTypeData = szBuf;
134 if (SetMenuItemInfo(hMenu, uPosition, uFlags, &mii))
135 {
136 return TRUE;
137 }
138 }
139
140 return FALSE;
141}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define _countof(array)
Definition: sndvol32.h:70
LPWSTR dwTypeData
Definition: winuser.h:3269
#define MIIM_STRING
Definition: winuser.h:727
#define SetMenuItemInfo
Definition: winuser.h:5850
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _vsntprintf
Definition: xmlstorage.h:203

Referenced by CStartMenuSite::AppendMenu().

◆ GetAdvancedBool()

BOOL GetAdvancedBool ( IN LPCWSTR  pszValueName,
IN BOOL  bDefaultValue 
)

Definition at line 156 of file util.cpp.

157{
158 return GetRegBool(REGKEY_ADVANCED, pszValueName, bDefaultValue);
159}
#define REGKEY_ADVANCED
Definition: util.cpp:154
BOOL GetRegBool(IN LPCWSTR pszSubKey, IN LPCWSTR pszValueName, IN BOOL bDefaultValue)
Definition: util.cpp:143

Referenced by CStartMenuSite::AppendMenu(), and CustomGetAdvanced().

◆ GetCurrentLoggedOnUserName()

BOOL GetCurrentLoggedOnUserName ( OUT LPWSTR  szBuffer,
IN DWORD  dwBufferSize 
)

Definition at line 73 of file util.cpp.

75{
76 DWORD dwType;
78
79 /* Query the user name from the registry */
80 dwSize = (dwBufferSize * sizeof(WCHAR)) - 1;
82 L"Logon User Name",
83 0,
84 &dwType,
85 (LPBYTE)szBuffer,
86 &dwSize) == ERROR_SUCCESS &&
87 (dwSize / sizeof(WCHAR)) > 1 &&
88 szBuffer[0] != L'\0')
89 {
90 szBuffer[dwSize / sizeof(WCHAR)] = L'\0';
91 return TRUE;
92 }
93
94 /* Fall back to GetUserName() */
95 dwSize = dwBufferSize;
96 if (!GetUserNameW(szBuffer, &dwSize))
97 {
98 szBuffer[0] = L'\0';
99 return FALSE;
100 }
101
102 return TRUE;
103}
HKEY hkExplorer
Definition: explorer.cpp:26
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
Definition: misc.c:291
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
unsigned char * LPBYTE
Definition: typedefs.h:53

Referenced by CStartMenuSite::AppendMenu().

◆ GetRegValue()

BOOL GetRegValue ( IN LPCWSTR  pszSubKey,
IN LPCWSTR  pszValueName,
IN BOOL  bDefaultValue 
)

◆ InitRSHELL()

VOID InitRSHELL ( VOID  )

Definition at line 27 of file rshell.cpp.

28{
29 ghRShell = LoadLibraryW(L"rshell.dll");
30}

Referenced by _tWinMain().

◆ InitShellServices()

HRESULT InitShellServices ( HDPA phdpa)

Definition at line 48 of file shellservice.cpp.

49{
50 IOleCommandTarget * pOct;
51 HKEY hkey;
55 DWORD type;
56 LONG ret;
57 HDPA hdpa;
58 HRESULT hr = S_OK;
59 int count = 0;
60
61 *phdpa = NULL;
62
63 TRACE("Enumerating Shell Service Object GUIDs...\n");
64
66 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ShellServiceObjectDelayLoad",
67 &hkey))
68 {
69 ERR("RegOpenKeyW failed.\n");
71 }
72
73 hdpa = DPA_Create(5);
74
75 /* Enumerate */
76 do
77 {
78 DWORD name_len = MAX_PATH;
79 DWORD value_len = sizeof(value); /* byte count! */
80
81 ret = RegEnumValueW(hkey, count, name, &name_len, 0, &type, (LPBYTE) &value, &value_len);
82 if (ret)
83 break;
84
85 if (type != REG_SZ)
86 {
87 WARN("Value type was not REG_SZ.\n");
88 continue;
89 }
90
93 {
94 ERR("CLSIDFromString failed %08x.\n", hr);
95 goto cleanup;
96 }
97
98 hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IOleCommandTarget, &pOct));
100 {
101 ERR("CoCreateInstance failed %08x.\n", hr);
102 goto cleanup;
103 }
104
105 DPA_AppendPtr(hdpa, pOct);
106
107 count++;
108 }
109 while (1);
110
112 {
113 ERR("RegEnumValueW failed %08x.\n", ret);
115 goto cleanup;
116 }
117
118 /* Initialize */
121 goto cleanup;
122
123 RegCloseKey(hkey);
124
125 *phdpa = hdpa;
126 return count > 0 ? S_OK : S_FALSE;
127
128cleanup:
129 RegCloseKey(hkey);
130 *phdpa = NULL;
132 return hr;
133}
#define WARN(fmt,...)
Definition: debug.h:115
#define ERR(fmt,...)
Definition: debug.h:113
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2830
VOID WINAPI DPA_EnumCallback(HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
Definition: dpa.c:969
HDPA WINAPI DPA_Create(INT nGrow)
Definition: dpa.c:950
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define MAX_PATH
Definition: compat.h:34
static void cleanup(void)
Definition: main.c:1335
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define REG_SZ
Definition: layer.c:22
REFCLSID clsid
Definition: msctf.c:82
#define DPA_AppendPtr(hdpa, pitem)
Definition: commctrl.h:4958
static int CALLBACK InitializeAllCallback(void *pItem, void *pData)
HRESULT ShutdownShellServices(HDPA hdpa)
Definition: dpa.c:49
Definition: name.c:39
Definition: pdh_main.c:94
int ret
#define S_FALSE
Definition: winerror.h:2357
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by CTrayWindow::OnCreate().

◆ IsSameObject()

HRESULT IsSameObject ( IN IUnknown punk1,
IN IUnknown punk2 
)

Definition at line 11 of file util.cpp.

12{
13 HRESULT hRet;
14
15 hRet = punk1->QueryInterface(IID_PPV_ARG(IUnknown, &punk1));
16 if (!SUCCEEDED(hRet))
17 return hRet;
18
19 hRet = punk2->QueryInterface(IID_PPV_ARG(IUnknown, &punk2));
20
21 punk1->Release();
22
23 if (!SUCCEEDED(hRet))
24 return hRet;
25
26 punk2->Release();
27
28 /* We're dealing with the same object if the IUnknown pointers are equal */
29 return (punk1 == punk2) ? S_OK : S_FALSE;
30}
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
ULONG Release()

Referenced by CTrayBandSite::IsTaskBand(), and CTrayBandSite::QueryBand().

◆ LoadPopupMenu()

HMENU LoadPopupMenu ( IN HINSTANCE  hInstance,
IN LPCWSTR  lpMenuName 
)

Definition at line 33 of file util.cpp.

35{
36 HMENU hMenu, hSubMenu = NULL;
37
38 hMenu = LoadMenuW(hInstance, lpMenuName);
39 if (hMenu != NULL)
40 {
41 hSubMenu = GetSubMenu(hMenu, 0);
42 if ((hSubMenu != NULL) &&
43 !RemoveMenu(hMenu, 0, MF_BYPOSITION))
44 {
45 hSubMenu = NULL;
46 }
47
48 DestroyMenu(hMenu);
49 }
50
51 return hSubMenu;
52}
HINSTANCE hInstance
Definition: charmap.c:19
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define MF_BYPOSITION
Definition: winuser.h:203
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI DestroyMenu(_In_ HMENU)
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)

Referenced by CStartMenuSite::AppendMenu(), CTrayWindowCtxMenu::QueryContextMenu(), and SettingsPageProc().

◆ ProcessStartupItems()

INT ProcessStartupItems ( VOID  )

Definition at line 453 of file startup.cpp.

454{
455 /* TODO: ProcessRunKeys already checks SM_CLEANBOOT -- items prefixed with * should probably run even in safe mode */
456 BOOL bNormalBoot = GetSystemMetrics(SM_CLEANBOOT) == 0; /* Perform the operations that are performed every boot */
457 /* First, set the current directory to SystemRoot */
458 WCHAR gen_path[MAX_PATH];
459 DWORD res;
460
461 res = GetWindowsDirectoryW(gen_path, _countof(gen_path));
462 if (res == 0)
463 {
464 TRACE("Couldn't get the windows directory - error %lu\n", GetLastError());
465
466 return 100;
467 }
468
469 if (!SetCurrentDirectoryW(gen_path))
470 {
471 TRACE("Cannot set the dir to %ls (%lu)\n", gen_path, GetLastError());
472
473 return 100;
474 }
475
476 /* Perform the operations by order checking if policy allows it, checking if this is not Safe Mode,
477 * stopping if one fails, skipping if necessary.
478 */
479 res = TRUE;
480
481 if (res && bNormalBoot)
483
486
487 if (res && bNormalBoot && (SHRestricted(REST_NOLOCALMACHINERUN) == 0))
489
490 if (res && bNormalBoot && (SHRestricted(REST_NOCURRENTUSERRUNONCE) == 0))
492
493 /* All users Startup folder */
495
496 /* Current user Startup folder */
498
499 /* TODO: HKCU\RunOnce runs even if StartupHasBeenRun exists */
500 if (res && bNormalBoot && (SHRestricted(REST_NOCURRENTUSERRUNONCE) == 0))
502
503 TRACE("Operation done\n");
504
505 return res ? 0 : 101;
506}
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
Definition: path.c:2249
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
GLuint res
Definition: glext.h:9613
#define CSIDL_COMMON_STARTUP
Definition: shlobj.h:2182
#define CSIDL_STARTUP
Definition: shlobj.h:2166
@ REST_NOCURRENTUSERRUNONCE
Definition: shlobj.h:1732
@ REST_NOLOCALMACHINERUNONCE
Definition: shlobj.h:1731
@ REST_NOLOCALMACHINERUN
Definition: shlobj.h:1729
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:146
static BOOL ProcessRunKeys(HKEY hkRoot, LPCWSTR szKeyName, BOOL bDelete, BOOL bSynchronous)
Definition: startup.cpp:136
static BOOL ProcessRunOnceEx(HKEY hkRoot)
Definition: startup.cpp:328
static BOOL AutoStartupApplications(INT nCSIDL_Folder)
Definition: startup.cpp:384
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define SM_CLEANBOOT
Definition: winuser.h:1027
int WINAPI GetSystemMetrics(_In_ int)

Referenced by StartWithDesktop().

◆ SetAdvancedDword()

BOOL SetAdvancedDword ( IN LPCWSTR  pszValueName,
IN DWORD  dwValue 
)

Definition at line 161 of file util.cpp.

162{
163 return SetRegDword(REGKEY_ADVANCED, pszValueName, dwValue);
164}
BOOL SetRegDword(IN LPCWSTR pszSubKey, IN LPCWSTR pszValueName, IN DWORD dwValue)
Definition: util.cpp:148

Referenced by CustomSetAdvanced().

◆ SetRegDword()

BOOL SetRegDword ( IN LPCWSTR  pszSubKey,
IN LPCWSTR  pszValueName,
IN DWORD  dwValue 
)

Definition at line 148 of file util.cpp.

149{
150 return (SHRegSetUSValueW(pszSubKey, pszValueName, REG_DWORD, &dwValue,
151 sizeof(dwValue), SHREGSET_FORCE_HKCU) == ERROR_SUCCESS);
152}
LONG WINAPI SHRegSetUSValueW(LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwType, LPVOID pvData, DWORD cbData, DWORD dwFlags)
Definition: reg.c:673
#define REG_DWORD
Definition: sdbapi.c:596
#define SHREGSET_FORCE_HKCU
Definition: shlwapi.h:312

Referenced by SetAdvancedDword().

◆ SetWindowExStyle()

static LONG SetWindowExStyle ( IN HWND  hWnd,
IN LONG  dwStyleMask,
IN LONG  dwStyle 
)
inlinestatic

Definition at line 83 of file precomp.h.

86{
87 return SHSetWindowBits(hWnd, GWL_EXSTYLE, dwStyleMask, dwStyle);
88}
LONG WINAPI SHSetWindowBits(HWND hwnd, INT offset, UINT mask, UINT flags)
Definition: ordinal.c:1126
#define GWL_EXSTYLE
Definition: winuser.h:851

◆ SetWindowStyle()

static LONG SetWindowStyle ( IN HWND  hWnd,
IN LONG  dwStyleMask,
IN LONG  dwStyle 
)
inlinestatic

Definition at line 74 of file precomp.h.

77{
78 return SHSetWindowBits(hWnd, GWL_STYLE, dwStyleMask, dwStyle);
79}
#define GWL_STYLE
Definition: winuser.h:852

◆ ShowCustomizeClassic()

VOID ShowCustomizeClassic ( HINSTANCE  hInst,
HWND  hExplorer 
)

Definition at line 261 of file startmnucust.cpp.

262{
264}
#define IDD_CLASSICSTART_CUSTOMIZE
Definition: resource.h:87
HINSTANCE hInst
Definition: dxdiag.c:13
INT_PTR CALLBACK CustomizeClassicProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4399

Referenced by CStartMenuSettingsPage::OnStartMenuCustomize().

◆ ShowCustomizeNotifyIcons()

VOID ShowCustomizeNotifyIcons ( HINSTANCE  hInst,
HWND  hExplorer 
)

Definition at line 47 of file notifyiconscust.cpp.

48{
50}
#define IDD_NOTIFICATIONS_CUSTOMIZE
Definition: resource.h:86
INT_PTR CALLBACK CustomizeNotifyIconsProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)

Referenced by CTrayWindow::ExecContextMenuCmd(), and CNotifySettingsPage::OnCustomizeTrayIcons().

◆ ShutdownShellServices()

HRESULT ShutdownShellServices ( HDPA  hdpa)

Definition at line 135 of file shellservice.cpp.

136{
139 DPA_Destroy(hdpa);
140 return S_OK;
141}
BOOL WINAPI DPA_Destroy(HDPA hdpa)
Definition: dpa.c:396
static int CALLBACK DeleteAllEnumCallback(void *pItem, void *pData)
static int CALLBACK ShutdownAllCallback(void *pItem, void *pData)

Referenced by InitShellServices(), and CTrayWindow::~CTrayWindow().

◆ Tray_OnStartMenuDismissed()

HRESULT Tray_OnStartMenuDismissed ( ITrayWindow *  Tray)

Definition at line 3892 of file traywnd.cpp.

3893{
3894 CTrayWindow * TrayWindow = static_cast<CTrayWindow *>(Tray);
3895 return TrayWindow->RaiseStartButton();
3896}
virtual HRESULT RaiseStartButton()
Definition: traywnd.cpp:3702

Referenced by CStartMenuSite::SetSubMenu().

◆ TrayMessageLoop()

VOID TrayMessageLoop ( IN OUT ITrayWindow *  Tray)

Referenced by StartWithDesktop().

◆ TrayProcessMessages()

VOID TrayProcessMessages ( IN OUT ITrayWindow *  Tray)

◆ UpdateStartMenu()

HRESULT UpdateStartMenu ( IN OUT IMenuPopup pMenuPopup,
IN HBITMAP hbmBanner  OPTIONAL,
IN BOOL  bSmallIcons,
IN BOOL  bRefresh 
)

Definition at line 24 of file startmnu.cpp.

28{
30 HRESULT hRet;
31
32 hRet = pMenuPopup->QueryInterface(IID_PPV_ARG(IBanneredBar, &pbb));
33 if (SUCCEEDED(hRet))
34 {
35 hRet = pbb->SetBitmap(hbmBanner);
36
37 /* Update the icon size */
38 hRet = pbb->SetIconSize(bSmallIcons ? BMICON_SMALL : BMICON_LARGE);
39 }
40
41 if (bRefresh)
42 {
43 FIXME("Refresh the Start menu with communicating with SHELL32\n");
44 }
45
46 return hRet;
47}
#define FIXME(fmt,...)
Definition: debug.h:114
@ BMICON_SMALL
Definition: shlobj_undoc.h:115
@ BMICON_LARGE
Definition: shlobj_undoc.h:114

Referenced by CreateStartMenu(), and CTrayWindow::OnSettingChanged().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( explorernew  )

Variable Documentation

◆ bExplorerIsShell

BOOL bExplorerIsShell
extern

Definition at line 27 of file explorer.cpp.

Referenced by _tWinMain(), and DoStartStartupItems().

◆ CLSID_ITaskBand

const GUID CLSID_ITaskBand
extern

◆ g_TaskbarSettings

◆ hExplorerInstance

◆ hkExplorer

◆ hProcessHeap

HANDLE hProcessHeap
extern

Definition at line 37 of file kbswitch.c.

◆ IID_IShellDesktopTray

const GUID IID_IShellDesktopTray
extern

Definition at line 191 of file traywnd.cpp.