ReactOS 0.4.15-dev-6056-gb29b268
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 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
 

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 GetExplorerRegValueSet (IN HKEY hKey, IN LPCWSTR lpSubKey, IN LPCWSTR lpValue)
 
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)
 
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 57 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 268 of file precomp.h.

◆ INTERFACE [2/2]

#define INTERFACE   ITrayBandSite

Definition at line 268 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 297 of file precomp.h.

◆ ITrayBandSite_AddRef

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

Definition at line 289 of file precomp.h.

◆ ITrayBandSite_IsTaskBand

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

Definition at line 295 of file precomp.h.

◆ ITrayBandSite_Lock

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

Definition at line 298 of file precomp.h.

◆ ITrayBandSite_OnLoad

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

Definition at line 292 of file precomp.h.

◆ ITrayBandSite_OnSave

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

Definition at line 293 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 296 of file precomp.h.

◆ ITrayBandSite_QueryInterface

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

Definition at line 288 of file precomp.h.

◆ ITrayBandSite_Release

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

Definition at line 290 of file precomp.h.

◆ ITrayWindow_AddRef

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

Definition at line 160 of file precomp.h.

◆ ITrayWindow_Close

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

Definition at line 164 of file precomp.h.

◆ ITrayWindow_DisplayProperties

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

Definition at line 168 of file precomp.h.

◆ ITrayWindow_ExecContextMenuCmd

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

Definition at line 169 of file precomp.h.

◆ ITrayWindow_GetHWND

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

Definition at line 165 of file precomp.h.

◆ ITrayWindow_IsHorizontal

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

Definition at line 167 of file precomp.h.

◆ ITrayWindow_IsSpecialHWND

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

Definition at line 166 of file precomp.h.

◆ ITrayWindow_IsTaskWnd

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

Definition at line 171 of file precomp.h.

◆ ITrayWindow_Lock

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

Definition at line 170 of file precomp.h.

◆ ITrayWindow_Open

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

Definition at line 163 of file precomp.h.

◆ ITrayWindow_QueryInterface

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

Definition at line 159 of file precomp.h.

◆ ITrayWindow_Release

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

Definition at line 161 of file precomp.h.

◆ NTNWM_REALIGN

#define NTNWM_REALIGN   (0x1)

Definition at line 339 of file precomp.h.

◆ TNWM_CHANGETRAYPOS

#define TNWM_CHANGETRAYPOS   (WM_USER + 0x104)

Definition at line 337 of file precomp.h.

◆ TNWM_GETMINIMUMSIZE

#define TNWM_GETMINIMUMSIZE   (WM_USER + 0x100)

Definition at line 336 of file precomp.h.

◆ TSWM_UPDATETASKBARPOS

#define TSWM_UPDATETASKBARPOS   (WM_USER + 2)

Definition at line 350 of file precomp.h.

◆ TWM_GETTASKSWITCH

#define TWM_GETTASKSWITCH   (WM_USER + 236)

Definition at line 130 of file precomp.h.

◆ TWM_OPENSTARTMENU

#define TWM_OPENSTARTMENU   (WM_USER + 260)

Definition at line 131 of file precomp.h.

◆ TWM_PULSE

#define TWM_PULSE   (WM_USER + 400)

Definition at line 133 of file precomp.h.

◆ TWM_SETTINGSCHANGED

#define TWM_SETTINGSCHANGED   (WM_USER + 300)

Definition at line 132 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

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 44 of file startmnu.cpp.

48{
49 HRESULT hr;
56 DWORD dwBandId = 0;
57
60 return NULL;
61
64 return NULL;
65
66 /* Set the menu site so we can handle messages */
67 hr = IUnknown_SetSite(pMp, pSms);
69 return NULL;
70
71 /* Initialize the menu object */
72 hr = pMp->QueryInterface(IID_PPV_ARG(IInitializeObject, &pIo));
73 if (SUCCEEDED(hr))
74 hr = pIo->Initialize();
75 else
76 hr = S_OK;
77
78 /* Everything is initialized now. Let's get the IMenuBand interface. */
80 return NULL;
81
82 hr = pMp->GetClient(&pUnk);
84 return NULL;
85
88 return NULL;
89
90 /* Finally we have the IBandSite interface, there's only one
91 band in it that apparently provides the IMenuBand interface */
92 hr = pBs->EnumBands(0, &dwBandId);
94 return NULL;
95
96 hr = pBs->GetBandObject(dwBandId, IID_PPV_ARG(IMenuBand, &pMb));
98 return NULL;
99
100 UpdateStartMenu(pMp,
101 hbmBanner,
102 bSmallIcons);
103
104 *ppMenuBand = pMb.Detach();
105
106 return pMp.Detach();
107}
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:163
HRESULT WINAPI IUnknown_SetSite(IUnknown *obj, IUnknown *site)
Definition: ordinal.c:1404
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
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
HRESULT hr
Definition: shlfolder.c:183
HRESULT UpdateStartMenu(IN OUT IMenuPopup *pMenuPopup, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons)
Definition: startmnu.cpp:24
#define IID_PPV_ARG(Itype, ppType)

Referenced by CTrayWindow::OnCreate().

◆ CreateTrayWindow()

HRESULT CreateTrayWindow ( ITrayWindow **  ppTray)

Definition at line 3852 of file traywnd.cpp.

3853{
3855 if (Tray == NULL)
3856 return E_OUTOFMEMORY;
3857
3858 Tray->_Init();
3859 Tray->Open();
3860
3861 *ppTray = (ITrayWindow *) Tray;
3862
3863 return S_OK;
3864}
#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 243 of file startctxmnu.cpp.

244{
245 return ShellObjectCreatorInit<CStartMenuBtnCtxMenu>(m_TrayWnd, m_Owner, IID_PPV_ARG(IContextMenu, ppCtxMenu));
246}

Referenced by CTrayWindow::OnContextMenu().

◆ CStartMenuSite_CreateInstance()

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

Definition at line 385 of file startmnusite.cpp.

386{
387 return ShellObjectCreatorInit<CStartMenuSite>(Tray, riid, ppv);
388}

Referenced by CreateStartMenu().

◆ CSysPagerWnd_CreateInstance()

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

Definition at line 1584 of file syspager.cpp.

1585{
1586 return ShellObjectCreatorInit<CSysPagerWnd>(hwndParent, riid, ppv);
1587}
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 2013 of file taskswnd.cpp.

2014{
2015 return ShellObjectCreatorInit<CTaskSwitchWnd>(hWndParent, Tray, riid, ppv);
2016}

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 747 of file trayclock.cpp.

748{
749 return ShellObjectCreatorInit<CTrayClockWnd>(hwndParent, riid, ppv);
750}

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 269 of file precomp.h.

270{
271 /*** IUnknown methods ***/
275 /*** IBandSiteStreamCallback ***/
276 STDMETHOD_(HRESULT, OnLoad)(THIS_ IStream *pStm, REFIID riid, PVOID *pvObj) PURE;
277 STDMETHOD_(HRESULT, OnSave)(THIS_ IUnknown *pUnk, IStream *pStm) PURE;
278 /*** ITrayBandSite methods ***/
279 STDMETHOD_(HRESULT, IsTaskBand) (THIS_ IUnknown *punk) PURE;
280 STDMETHOD_(HRESULT, ProcessMessage) (THIS_ HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult) PURE;
281 STDMETHOD_(HRESULT, AddContextMenus) (THIS_ HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags, IContextMenu **ppcm) PURE;
283};
HWND hWnd
Definition: settings.c:17
#define THIS_
Definition: basetyps.h:65
#define THIS
Definition: basetyps.h:66
#define PURE
Definition: basetyps.h:64
#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:60
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 138 of file precomp.h.

139{
140 /*** IUnknown methods ***/
144 /*** ITrayWindow methods ***/
147 STDMETHOD_(HWND, GetHWND) (THIS) PURE;
148 STDMETHOD_(BOOL, IsSpecialHWND) (THIS_ HWND hWnd) PURE;
149 STDMETHOD_(BOOL, IsHorizontal) (THIS) PURE;
150 STDMETHOD_(HWND, DisplayProperties) (THIS) PURE;
151 STDMETHOD_(BOOL, ExecContextMenuCmd) (THIS_ UINT uiCmd) PURE;
152 STDMETHOD_(BOOL, Lock) (THIS_ BOOL bLock) PURE;
153 STDMETHOD_(BOOL, IsTaskWnd) (THIS_ HWND hWnd) PURE;
154};
#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 291 of file trayprop.cpp.

292{
293 PROPSHEETHEADER psh;
294 HPROPSHEETPAGE hpsp[2];
295 CTaskBarSettingsPage tbSettingsPage(hwndTaskbar);
296 CStartMenuSettingsPage smSettingsPage;
297 CStringW caption;
298
299 caption.LoadStringW(IDS_TASKBAR_STARTMENU_PROP_CAPTION);
300
301 hpsp[0] = tbSettingsPage.Create();
302 hpsp[1] = smSettingsPage.Create();
303
304 ZeroMemory(&psh, sizeof(psh));
305 psh.dwSize = sizeof(psh);
307 psh.hwndParent = hwndOwner;
308 psh.hInstance = hExplorerInstance;
309 psh.pszIcon = MAKEINTRESOURCEW(IDI_STARTMENU);
310 psh.pszCaption = caption.GetString();
311 psh.nPages = _countof(hpsp);
312 psh.nStartPage = 0;
313 psh.phpage = hpsp;
314 psh.pfnCallback = PropSheetProc;
315
316 PropertySheet(&psh);
317}
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
#define IDI_STARTMENU
Definition: resource.h:14
#define IDS_TASKBAR_STARTMENU_PROP_CAPTION
Definition: resource.h:103
HPROPSHEETPAGE Create()
Definition: rosdlgs.h:57
PCXSTR GetString() const
Definition: atlsimpstr.h:361
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#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
#define _countof(array)
Definition: sndvol32.h:68
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: trayprop.cpp:274
#define ZeroMemory
Definition: winbase.h:1670
#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:47
#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:1091
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:146
#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:1040
#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:718
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
LPWSTR dwTypeData
Definition: winuser.h:3259
#define MIIM_STRING
Definition: winuser.h:722
#define SetMenuItemInfo
Definition: winuser.h:5840
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _vsntprintf
Definition: xmlstorage.h:203

Referenced by CStartMenuSite::AppendMenu().

◆ 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:4118
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().

◆ GetExplorerRegValueSet()

BOOL GetExplorerRegValueSet ( IN HKEY  hKey,
IN LPCWSTR  lpSubKey,
IN LPCWSTR  lpValue 
)

Definition at line 144 of file util.cpp.

147{
148 WCHAR szBuffer[MAX_PATH];
149 HKEY hkSubKey;
150 DWORD dwType, dwSize;
151 BOOL Ret = FALSE;
152
153 StringCbCopyW(szBuffer, sizeof(szBuffer),
154 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer");
155 if (FAILED_UNEXPECTEDLY(StringCbCatW(szBuffer, sizeof(szBuffer), L"\\")))
156 return FALSE;
157 if (FAILED_UNEXPECTEDLY(StringCbCatW(szBuffer, sizeof(szBuffer), lpSubKey)))
158 return FALSE;
159
160 dwSize = sizeof(szBuffer);
162 szBuffer,
163 0,
165 &hkSubKey) == ERROR_SUCCESS)
166 {
167 ZeroMemory(szBuffer, sizeof(szBuffer));
168
169 if (RegQueryValueExW(hkSubKey,
170 lpValue,
171 0,
172 &dwType,
173 (LPBYTE)szBuffer,
175 {
176 if ((dwType == REG_DWORD) && (dwSize == sizeof(DWORD)))
177 Ret = *((PDWORD)szBuffer) != 0;
178 else if (dwSize > 0)
179 Ret = *((PWCHAR)szBuffer) != 0;
180 }
181
182 RegCloseKey(hkSubKey);
183 }
184 return Ret;
185}
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3353
#define MAX_PATH
Definition: compat.h:34
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
DWORD * PDWORD
Definition: pedump.c:68
#define REG_DWORD
Definition: sdbapi.c:596
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
uint16_t * PWCHAR
Definition: typedefs.h:56

Referenced by CStartMenuSite::AppendMenu().

◆ 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:112
#define ERR(fmt,...)
Definition: debug.h:110
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3288
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:2850
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
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:2048
#define CSIDL_STARTUP
Definition: shlobj.h:2032
@ REST_NOCURRENTUSERRUNONCE
Definition: shlobj.h:1663
@ REST_NOLOCALMACHINERUNONCE
Definition: shlobj.h:1662
@ REST_NOLOCALMACHINERUN
Definition: shlobj.h:1660
DWORD WINAPI SHRestricted(RESTRICTIONS policy)
Definition: shpolicy.c:827
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:1021
int WINAPI GetSystemMetrics(_In_ int)

Referenced by StartWithDesktop().

◆ SetWindowExStyle()

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

Definition at line 82 of file precomp.h.

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

◆ SetWindowStyle()

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

Definition at line 73 of file precomp.h.

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

◆ ShowCustomizeClassic()

VOID ShowCustomizeClassic ( HINSTANCE  hInst,
HWND  hExplorer 
)

Definition at line 109 of file startmnucust.cpp.

110{
112}
#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:4389

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 CTaskBarSettingsPage::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 3867 of file traywnd.cpp.

3868{
3869 CTrayWindow * TrayWindow = static_cast<CTrayWindow *>(Tray);
3870 return TrayWindow->RaiseStartButton();
3871}
virtual HRESULT RaiseStartButton()
Definition: traywnd.cpp:3676

Referenced by CStartMenuSite::SetSubMenu().

◆ TrayMessageLoop()

VOID TrayMessageLoop ( IN OUT ITrayWindow *  Tray)

Referenced by StartWithDesktop().

◆ TrayProcessMessages()

VOID TrayProcessMessages ( IN OUT ITrayWindow *  Tray)

◆ 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 43 of file kbswitch.c.

◆ IID_IShellDesktopTray

const GUID IID_IShellDesktopTray
extern

Definition at line 184 of file traywnd.cpp.