ReactOS  0.4.13-dev-73-gcfe54aa
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 <rosctrls.h>
#include <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 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 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 265 of file precomp.h.

◆ INTERFACE [2/2]

#define INTERFACE   ITrayBandSite

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

◆ ITrayBandSite_AddRef

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

Definition at line 286 of file precomp.h.

◆ ITrayBandSite_IsTaskBand

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

Definition at line 292 of file precomp.h.

◆ ITrayBandSite_Lock

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

Definition at line 295 of file precomp.h.

◆ ITrayBandSite_OnLoad

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

Definition at line 289 of file precomp.h.

◆ ITrayBandSite_OnSave

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

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

◆ ITrayBandSite_QueryInterface

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

Definition at line 285 of file precomp.h.

◆ ITrayBandSite_Release

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

Definition at line 287 of file precomp.h.

◆ ITrayWindow_AddRef

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

Definition at line 158 of file precomp.h.

◆ ITrayWindow_Close

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

Definition at line 162 of file precomp.h.

◆ ITrayWindow_DisplayProperties

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

Definition at line 166 of file precomp.h.

◆ ITrayWindow_ExecContextMenuCmd

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

Definition at line 167 of file precomp.h.

◆ ITrayWindow_GetHWND

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

Definition at line 163 of file precomp.h.

◆ ITrayWindow_IsHorizontal

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

Definition at line 165 of file precomp.h.

◆ ITrayWindow_IsSpecialHWND

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

Definition at line 164 of file precomp.h.

◆ ITrayWindow_Lock

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

Definition at line 168 of file precomp.h.

◆ ITrayWindow_Open

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

Definition at line 161 of file precomp.h.

◆ ITrayWindow_QueryInterface

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

Definition at line 157 of file precomp.h.

◆ ITrayWindow_Release

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

Definition at line 159 of file precomp.h.

◆ NTNWM_REALIGN

#define NTNWM_REALIGN   (0x1)

Definition at line 336 of file precomp.h.

◆ TNWM_CHANGETRAYPOS

#define TNWM_CHANGETRAYPOS   (WM_USER + 0x104)

Definition at line 334 of file precomp.h.

◆ TNWM_GETMINIMUMSIZE

#define TNWM_GETMINIMUMSIZE   (WM_USER + 0x100)

Definition at line 333 of file precomp.h.

◆ TSWM_UPDATETASKBARPOS

#define TSWM_UPDATETASKBARPOS   (WM_USER + 2)

Definition at line 347 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_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 }
GLenum func
Definition: glext.h:6028
REFIID riid
Definition: precomp.h:44
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
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define GetProcAddress(x, y)
Definition: compat.h:410

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 }
GLenum func
Definition: glext.h:6028
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HINSTANCE ghRShell
Definition: rshell.cpp:23
HRESULT(WINAPI * CBANDSITEMENU_CREATEINSTANCE)(REFIID riid, void **ppv)
Definition: rshell.cpp:166
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define GetProcAddress(x, y)
Definition: compat.h:410

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 }
GLenum func
Definition: glext.h:6028
HRESULT(WINAPI * PSTARTMENU_CREATEINSTANCE)(REFIID riid, void **ppv)
Definition: rshell.cpp:25
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HINSTANCE ghRShell
Definition: rshell.cpp:23
smooth NULL
Definition: ftsmooth.c:416
const GUID CLSID_StartMenu
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define GetProcAddress(x, y)
Definition: compat.h:410

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 }
GLenum func
Definition: glext.h:6028
static HINSTANCE ghRShell
Definition: rshell.cpp:23
const char * LPCSTR
Definition: xmlstorage.h:183
HANDLE(WINAPI * PSHCREATEDESKTOP)(IShellDesktopTray *ShellDesk)
Definition: rshell.cpp:50
static const WCHAR L[]
Definition: oid.c:1250
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:845
#define GetProcAddress(x, y)
Definition: compat.h:410

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 }
GLenum func
Definition: glext.h:6028
BOOL(WINAPI * PSHDESKTOPMESSAGELOOP)(HANDLE hDesktop)
Definition: rshell.cpp:79
static HINSTANCE ghRShell
Definition: rshell.cpp:23
const char * LPCSTR
Definition: xmlstorage.h:183
static const WCHAR L[]
Definition: oid.c:1250
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:845
#define GetProcAddress(x, y)
Definition: compat.h:410

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  {
157  PSHELLDDEINIT func = (PSHELLDDEINIT) GetProcAddress(hFallback, (LPCSTR) 188);
158  if (func)
159  {
160  func(bInit);
161  return;
162  }
163  }
164 }
GLenum func
Definition: glext.h:6028
static HINSTANCE ghRShell
Definition: rshell.cpp:23
const char * LPCSTR
Definition: xmlstorage.h:183
void(WINAPI * PSHELLDDEINIT)(BOOL bInit)
Definition: rshell.cpp:137
static const WCHAR L[]
Definition: oid.c:1250
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:845
#define GetProcAddress(x, y)
Definition: compat.h:410

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  {
127  PWINLIST_INIT func = (PWINLIST_INIT) GetProcAddress(hFallback, (LPCSTR) 110);
128  if (func)
129  {
130  return func();
131  }
132  }
133 
134  return 0;
135 }
GLenum func
Definition: glext.h:6028
static HINSTANCE ghRShell
Definition: rshell.cpp:23
#define LoadLibraryW(x)
Definition: compat.h:404
const char * LPCSTR
Definition: xmlstorage.h:183
DWORD(WINAPI * PWINLIST_INIT)(void)
Definition: rshell.cpp:108
static const WCHAR L[]
Definition: oid.c:1250
#define GetProcAddress(x, y)
Definition: compat.h:410

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;
51  CComPtr<IUnknown> pSms;
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 WINAPI _CStartMenu_CreateInstance(REFIID riid, void **ppv)
Definition: rshell.cpp:32
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)
HRESULT WINAPI IUnknown_SetSite(IUnknown *obj, IUnknown *site)
Definition: ordinal.c:1358
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT CStartMenuSite_CreateInstance(IN OUT ITrayWindow *Tray, const IID &riid, PVOID *ppv)
#define S_OK
Definition: intsafe.h:59
T * Detach()
Definition: atlcomcli.h:156
nsresult QueryInterface(nsIIDRef riid, void **result)
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by CTrayWindow::OnCreate().

◆ CreateTrayWindow()

HRESULT CreateTrayWindow ( ITrayWindow **  ppTray)

Definition at line 3390 of file traywnd.cpp.

3391 {
3393  if (Tray == NULL)
3394  return E_OUTOFMEMORY;
3395 
3396  Tray->_Init();
3397  Tray->Open();
3398 
3399  *ppTray = (ITrayWindow *) Tray;
3400 
3401  return S_OK;
3402 }
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59

Referenced by StartWithDesktop().

◆ CStartMenuBtnCtxMenu_CreateInstance()

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

Definition at line 240 of file startctxmnu.cpp.

241 {
243  mnu->Initialize(m_TrayWnd, m_Owner);
244  *ppCtxMenu = mnu;
245  return S_OK;
246 }
#define S_OK
Definition: intsafe.h:59
HRESULT Initialize(ITrayWindow *pTrayWnd, IN HWND hWndOwner)

Referenced by CTrayWindow::OnContextMenu().

◆ CStartMenuSite_CreateInstance()

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

Definition at line 386 of file startmnusite.cpp.

387 {
388  return ShellObjectCreatorInit<CStartMenuSite>(Tray, riid, ppv);
389 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39

Referenced by CreateStartMenu().

◆ CSysPagerWnd_CreateInstance()

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

Definition at line 1573 of file syspager.cpp.

1574 {
1575  return ShellObjectCreatorInit<CSysPagerWnd>(hwndParent, riid, ppv);
1576 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
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 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39

Referenced by CTrayWindow::OnCreate().

◆ CTaskSwitchWnd_CreateInstance()

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

Definition at line 1983 of file taskswnd.cpp.

1984 {
1985  return ShellObjectCreatorInit<CTaskSwitchWnd>(hWndParent, Tray, riid, ppv);
1986 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39

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 
719  CTrayBandSite * tb = new CTrayBandSite();
720  if (!tb)
721  return E_FAIL;
722 
723  tb->AddRef();
724 
725  hr = tb->_Init(tray, pTaskBand);
726  if (FAILED_UNEXPECTEDLY(hr))
727  {
728  tb->Release();
729  return hr;
730  }
731 
732  *pBandSite = tb;
733 
734  return S_OK;
735 }
HRESULT hr
Definition: shlfolder.c:183
#define E_FAIL
Definition: ddrawi.h:102
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
static const WCHAR tb[]
Definition: suminfo.c:286
#define S_OK
Definition: intsafe.h:59

Referenced by CTrayWindow::OnCreate().

◆ CTrayClockWnd_CreateInstance()

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

Definition at line 753 of file trayclock.cpp.

754 {
755  return ShellObjectCreatorInit<CTrayClockWnd>(hwndParent, riid, ppv);
756 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HWND hwndParent
Definition: cryptui.c:300

Referenced by CTrayNotifyWnd::OnCreate().

◆ CTrayNotifyWnd_CreateInstance()

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

Definition at line 368 of file trayntfy.cpp.

369 {
370  return ShellObjectCreatorInit<CTrayNotifyWnd>(hwndParent, riid, ppv);
371 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HWND hwndParent
Definition: cryptui.c:300

Referenced by CTrayWindow::OnCreate().

◆ DECLARE_INTERFACE_() [1/2]

DECLARE_INTERFACE_ ( ITrayWindow  ,
IUnknown   
)

Definition at line 137 of file precomp.h.

138 {
139  /*** IUnknown methods ***/
143  /*** ITrayWindow methods ***/
146  STDMETHOD_(HWND, GetHWND) (THIS) PURE;
147  STDMETHOD_(BOOL, IsSpecialHWND) (THIS_ HWND hWnd) PURE;
148  STDMETHOD_(BOOL, IsHorizontal) (THIS) PURE;
149  STDMETHOD_(HWND, DisplayProperties) (THIS) PURE;
150  STDMETHOD_(BOOL, ExecContextMenuCmd) (THIS_ UINT uiCmd) PURE;
151  STDMETHOD_(BOOL, Lock) (THIS_ BOOL bLock) PURE;
152 };
#define REFIID
Definition: guiddef.h:113
#define THIS_
Definition: basetyps.h:65
_In_ BOOLEAN Release
Definition: classpnp.h:929
#define THIS
Definition: basetyps.h:66
REFIID riid
Definition: precomp.h:44
HWND hWnd
Definition: settings.c:17
NTSTATUS QueryInterface(IN PDEVICE_OBJECT DeviceObject, IN CONST GUID InterfaceType, IN LONG Size, IN LONG Version, OUT PVOID Interface)
Definition: fdo.c:532
#define Open
Definition: syshdrs.h:62
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG HRESULT
Definition: typedefs.h:77
REFIID LPVOID * ppvObject
Definition: precomp.h:44
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
Definition: sacdrv.h:267
#define PURE
Definition: basetyps.h:64
unsigned int UINT
Definition: ndis.h:50
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
unsigned int ULONG
Definition: retypes.h:1
#define STDMETHOD_(t, m)
Definition: basetyps.h:63

◆ DECLARE_INTERFACE_() [2/2]

DECLARE_INTERFACE_ ( ITrayBandSite  ,
IUnknown   
)

Definition at line 266 of file precomp.h.

267 {
268  /*** IUnknown methods ***/
272  /*** IBandSiteStreamCallback ***/
273  STDMETHOD_(HRESULT, OnLoad)(THIS_ IStream *pStm, REFIID riid, PVOID *pvObj) PURE;
274  STDMETHOD_(HRESULT, OnSave)(THIS_ IUnknown *pUnk, IStream *pStm) PURE;
275  /*** ITrayBandSite methods ***/
276  STDMETHOD_(HRESULT, IsTaskBand) (THIS_ IUnknown *punk) PURE;
277  STDMETHOD_(HRESULT, ProcessMessage) (THIS_ HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult) PURE;
278  STDMETHOD_(HRESULT, AddContextMenus) (THIS_ HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags, IContextMenu **ppcm) PURE;
279  STDMETHOD_(HRESULT, Lock) (THIS_ BOOL bLock) PURE;
280 };
#define REFIID
Definition: guiddef.h:113
#define THIS_
Definition: basetyps.h:65
static HMENU hmenu
Definition: win.c:66
_In_ BOOLEAN Release
Definition: classpnp.h:929
#define THIS
Definition: basetyps.h:66
REFIID riid
Definition: precomp.h:44
HWND hWnd
Definition: settings.c:17
UINT_PTR WPARAM
Definition: windef.h:207
UINT uFlags
Definition: api.c:60
NTSTATUS QueryInterface(IN PDEVICE_OBJECT DeviceObject, IN CONST GUID InterfaceType, IN LONG Size, IN LONG Version, OUT PVOID Interface)
Definition: fdo.c:532
WPARAM wParam
Definition: combotst.c:138
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG_PTR LPARAM
Definition: windef.h:208
LONG HRESULT
Definition: typedefs.h:77
REFIID LPVOID * ppvObject
Definition: precomp.h:44
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
#define PURE
Definition: basetyps.h:64
unsigned int UINT
Definition: ndis.h:50
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
unsigned int ULONG
Definition: retypes.h:1
LONG_PTR LRESULT
Definition: windef.h:209
#define STDMETHOD_(t, m)
Definition: basetyps.h:63
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
LPARAM lParam
Definition: combotst.c:139

◆ DesktopCreateWindow()

HANDLE DesktopCreateWindow ( IN OUT ITrayWindow *  Tray)

Definition at line 118 of file desktop.cpp.

119 {
120  CDesktopThread* pDesktopThread = new CDesktopThread();
121 
122  HRESULT hres = pDesktopThread->Initialize(Tray);
124  {
125  delete pDesktopThread;
126  return NULL;
127  }
128 
129  return pDesktopThread;
130 }
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
HRESULT Initialize(IN OUT ITrayWindow *pTray)
Definition: desktop.cpp:71

Referenced by StartWithDesktop().

◆ DesktopDestroyShellWindow()

VOID DesktopDestroyShellWindow ( IN HANDLE  hDesktop)

Definition at line 133 of file desktop.cpp.

134 {
135  CDesktopThread* pDesktopThread = reinterpret_cast<CDesktopThread*>(hDesktop);
136  pDesktopThread->Destroy();
137 }
void Destroy()
Definition: desktop.cpp:111

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);
306  psh.dwFlags = PSH_PROPTITLE | PSH_USEICONID | PSH_USECALLBACK;
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 }
HPROPSHEETPAGE Create()
Definition: rosdlgs.h:57
#define _countof(array)
Definition: fontsub.cpp:30
#define IDI_STARTMENU
Definition: resource.h:14
#define ZeroMemory
Definition: winbase.h:1635
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSH_USEICONID
Definition: prsht.h:42
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define PROPSHEETHEADER
Definition: prsht.h:374
#define PSH_PROPTITLE
Definition: prsht.h:40
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
PCXSTR GetString() const
Definition: atlsimpstr.h:361
#define PropertySheet
Definition: prsht.h:382
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: trayprop.cpp:274
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDS_TASKBAR_STARTMENU_PROP_CAPTION
Definition: resource.h:103

Referenced by CTrayWindow::TrayPropertiesThread().

◆ DoFinishStartupItems()

BOOL DoFinishStartupItems ( VOID  )

Definition at line 389 of file startup.cpp.

390 {
391  if (s_hStartupMutex)
392  {
396  }
397  return TRUE;
398 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:564
static HANDLE s_hStartupMutex
Definition: startup.cpp:45

Referenced by DoStartStartupItems(), and StartWithDesktop().

◆ DoStartStartupItems()

BOOL DoStartStartupItems ( ITrayWindow *  Tray)

Definition at line 400 of file startup.cpp.

401 {
402  DWORD dwWait;
403 
404  if (!bExplorerIsShell)
405  return FALSE;
406 
407  if (!s_hStartupMutex)
408  {
409  // Accidentally, there is possibility that the system starts multiple Explorers
410  // before startup of shell. We use a mutex to match the timing of shell initialization.
411  s_hStartupMutex = CreateMutexW(NULL, FALSE, L"ExplorerIsShellMutex");
412  if (s_hStartupMutex == NULL)
413  return FALSE;
414  }
415 
417  TRACE("dwWait: 0x%08lX\n", dwWait);
418  if (dwWait != WAIT_OBJECT_0)
419  {
420  TRACE("LastError: %ld\n", GetLastError());
421 
423  return FALSE;
424  }
425 
426  const DWORD dwWaitTotal = 3000; // in milliseconds
427  DWORD dwTick = GetTickCount();
428  while (GetShellWindow() == NULL && GetTickCount() - dwTick < dwWaitTotal)
429  {
430  TrayProcessMessages(Tray);
431  }
432 
433  if (GetShellWindow() == NULL)
434  {
436  return FALSE;
437  }
438 
439  // Check the volatile "StartupHasBeenRun" key
440  HKEY hSessionKey, hKey;
441  HRESULT hr = SHCreateSessionKey(KEY_WRITE, &hSessionKey);
442  if (SUCCEEDED(hr))
443  {
444  ASSERT(hSessionKey);
445 
446  DWORD dwDisp;
447  LONG Error = RegCreateKeyExW(hSessionKey, L"StartupHasBeenRun", 0, NULL,
448  REG_OPTION_VOLATILE, KEY_WRITE, NULL, &hKey, &dwDisp);
449  RegCloseKey(hSessionKey);
450  RegCloseKey(hKey);
451  if (Error == ERROR_SUCCESS && dwDisp == REG_OPENED_EXISTING_KEY)
452  {
453  return FALSE; // Startup programs has already been run
454  }
455  }
456 
457  return TRUE;
458 }
BOOL DoFinishStartupItems(VOID)
Definition: startup.cpp:389
HWND WINAPI GetShellWindow(VOID)
Definition: desktop.c:651
#define TRUE
Definition: types.h:120
BOOL bExplorerIsShell
Definition: explorer.cpp:27
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
VOID TrayProcessMessages(IN OUT ITrayWindow *Tray)
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define REG_OPENED_EXISTING_KEY
Definition: nt_native.h:1085
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:1094
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define KEY_WRITE
Definition: nt_native.h:1031
#define TRACE(s)
Definition: solgame.cpp:4
#define WAIT_OBJECT_0
Definition: winbase.h:387
HRESULT WINAPI SHCreateSessionKey(REGSAM samDesired, PHKEY phKey)
Definition: shellreg.c:151
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL Error
Definition: chkdsk.c:66
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static const WCHAR L[]
Definition: oid.c:1250
static HANDLE s_hStartupMutex
Definition: startup.cpp:45
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:522
#define REG_OPTION_VOLATILE
Definition: nt_native.h:1060
#define INFINITE
Definition: serial.h:102
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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
smooth NULL
Definition: ftsmooth.c:416
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 }
#define TRUE
Definition: types.h:120
#define _countof(array)
Definition: fontsub.cpp:30
LPWSTR dwTypeData
Definition: winuser.h:3211
UINT uFlags
Definition: api.c:60
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
#define SetMenuItemInfo
Definition: winuser.h:5716
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _vsntprintf
Definition: xmlstorage.h:203
static const WCHAR L[]
Definition: oid.c:1250
#define MIIM_STRING
Definition: winuser.h:722
#define va_start(ap, A)
Definition: acmsvcex.h:91

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;
77  DWORD dwSize;
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 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
HKEY hkExplorer
Definition: explorer.cpp:26
unsigned char * LPBYTE
Definition: typedefs.h:52
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
Definition: misc.c:291
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

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);
161  if (RegOpenKeyExW(hKey,
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,
174  &dwSize) == ERROR_SUCCESS)
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 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ZeroMemory
Definition: winbase.h:1635
uint16_t * PWCHAR
Definition: typedefs.h:54
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
DWORD * PDWORD
Definition: pedump.c:68
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
#define REG_DWORD
Definition: sdbapi.c:596
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by CStartMenuSite::AppendMenu().

◆ InitRSHELL()

VOID InitRSHELL ( VOID  )

Definition at line 27 of file rshell.cpp.

28 {
29  ghRShell = LoadLibraryW(L"rshell.dll");
30 }
static HINSTANCE ghRShell
Definition: rshell.cpp:23
#define LoadLibraryW(x)
Definition: compat.h:404
static const WCHAR L[]
Definition: oid.c:1250

Referenced by _tWinMain().

◆ InitShellServices()

HRESULT InitShellServices ( HDPA phdpa)

Definition at line 48 of file shellservice.cpp.

49 {
50  IOleCommandTarget * pOct;
51  HKEY hkey;
52  CLSID clsid;
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 
111  if (ret != ERROR_NO_MORE_ITEMS)
112  {
113  ERR("RegEnumValueW failed %08x.\n", ret);
115  goto cleanup;
116  }
117 
118  RegCloseKey(hkey);
119 
120  /* Initialize */
122  if (FAILED_UNEXPECTEDLY(hr))
123  goto cleanup;
124 
125  *phdpa = hdpa;
126  return count > 0 ? S_OK : S_FALSE;
127 
128 cleanup:
129  *phdpa = NULL;
130  ShutdownShellServices(hdpa);
131  return hr;
132 }
HDPA WINAPI DPA_Create(INT nGrow)
Definition: dpa.c:950
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
HRESULT hr
Definition: shlfolder.c:183
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WARN(fmt,...)
Definition: debug.h:111
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define IID_PPV_ARG(Itype, ppType)
#define DPA_AppendPtr(hdpa, pitem)
Definition: commctrl.h:4929
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3311
#define S_FALSE
Definition: winerror.h:2357
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:2867
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
REFCLSID clsid
Definition: msctf.c:84
static const WCHAR L[]
Definition: oid.c:1250
VOID WINAPI DPA_EnumCallback(HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
Definition: dpa.c:969
GLsizei const GLfloat * value
Definition: glext.h:6069
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
Definition: name.c:36
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2247
HRESULT ShutdownShellServices(HDPA hdpa)
char * cleanup(char *str)
Definition: wpickclick.c:99
static int CALLBACK InitializeAllCallback(void *pItem, void *pData)
Definition: dpa.c:48
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22

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 }
#define IID_PPV_ARG(Itype, ppType)
#define S_FALSE
Definition: winerror.h:2357
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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:20
#define MF_BYPOSITION
Definition: winuser.h:203
smooth NULL
Definition: ftsmooth.c:416
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

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

◆ ProcessStartupItems()

INT ProcessStartupItems ( VOID  )

Definition at line 336 of file startup.cpp.

337 {
338  /* TODO: ProcessRunKeys already checks SM_CLEANBOOT -- items prefixed with * should probably run even in safe mode */
339  BOOL bNormalBoot = GetSystemMetrics(SM_CLEANBOOT) == 0; /* Perform the operations that are performed every boot */
340  /* First, set the current directory to SystemRoot */
341  WCHAR gen_path[MAX_PATH];
342  DWORD res;
343 
344  res = GetWindowsDirectoryW(gen_path, _countof(gen_path));
345  if (res == 0)
346  {
347  TRACE("Couldn't get the windows directory - error %lu\n", GetLastError());
348 
349  return 100;
350  }
351 
352  if (!SetCurrentDirectoryW(gen_path))
353  {
354  TRACE("Cannot set the dir to %ls (%lu)\n", gen_path, GetLastError());
355 
356  return 100;
357  }
358 
359  /* Perform the operations by order checking if policy allows it, checking if this is not Safe Mode,
360  * stopping if one fails, skipping if necessary.
361  */
362  res = TRUE;
363  /* TODO: RunOnceEx */
364 
367 
368  if (res && bNormalBoot && (SHRestricted(REST_NOLOCALMACHINERUN) == 0))
370 
371  if (res && bNormalBoot && (SHRestricted(REST_NOCURRENTUSERRUNONCE) == 0))
373 
374  /* All users Startup folder */
376 
377  /* Current user Startup folder */
379 
380  /* TODO: HKCU\RunOnce runs even if StartupHasBeenRun exists */
381  if (res && bNormalBoot && (SHRestricted(REST_NOCURRENTUSERRUNONCE) == 0))
383 
384  TRACE("Operation done\n");
385 
386  return res ? 0 : 101;
387 }
#define TRUE
Definition: types.h:120
#define _countof(array)
Definition: fontsub.cpp:30
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define CSIDL_COMMON_STARTUP
Definition: shlobj.h:2026
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static BOOL ProcessRunKeys(HKEY hkRoot, LPCWSTR szKeyName, BOOL bDelete, BOOL bSynchronous)
Definition: startup.cpp:109
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL AutoStartupApplications(INT nCSIDL_Folder)
Definition: startup.cpp:267
#define SM_CLEANBOOT
Definition: winuser.h:1017
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define CSIDL_STARTUP
Definition: shlobj.h:2010
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
Definition: path.c:2248
GLuint res
Definition: glext.h:9613
DWORD WINAPI SHRestricted(RESTRICTIONS policy)
Definition: shpolicy.c:836
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

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 }
HWND hWnd
Definition: settings.c:17
#define GWL_EXSTYLE
Definition: winuser.h:845
LONG WINAPI SHSetWindowBits(HWND hwnd, INT offset, UINT mask, UINT flags)
Definition: ordinal.c:1077

◆ 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 }
HWND hWnd
Definition: settings.c:17
LONG WINAPI SHSetWindowBits(HWND hwnd, INT offset, UINT mask, UINT flags)
Definition: ordinal.c:1077
#define GWL_STYLE
Definition: winuser.h:846

◆ ShowCustomizeClassic()

VOID ShowCustomizeClassic ( HINSTANCE  ,
HWND   
)

Definition at line 109 of file startmnucust.cpp.

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

Referenced by CStartMenuSettingsPage::OnStartMenuCustomize().

◆ ShowCustomizeNotifyIcons()

VOID ShowCustomizeNotifyIcons ( HINSTANCE  ,
HWND   
)

Definition at line 47 of file notifyiconscust.cpp.

48 {
50 }
INT_PTR CALLBACK CustomizeNotifyIconsProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
#define IDD_NOTIFICATIONS_CUSTOMIZE
Definition: resource.h:86
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4268
HINSTANCE hInst
Definition: dxdiag.c:13
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

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

◆ ShutdownShellServices()

HRESULT ShutdownShellServices ( HDPA  hdpa)

Definition at line 134 of file shellservice.cpp.

135 {
138  DPA_Destroy(hdpa);
139  return S_OK;
140 }
BOOL WINAPI DPA_Destroy(HDPA hdpa)
Definition: dpa.c:396
static int CALLBACK DeleteAllEnumCallback(void *pItem, void *pData)
smooth NULL
Definition: ftsmooth.c:416
static int CALLBACK ShutdownAllCallback(void *pItem, void *pData)
VOID WINAPI DPA_EnumCallback(HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
Definition: dpa.c:969
#define S_OK
Definition: intsafe.h:59

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

◆ Tray_OnStartMenuDismissed()

HRESULT Tray_OnStartMenuDismissed ( ITrayWindow *  Tray)

Definition at line 3405 of file traywnd.cpp.

3406 {
3407  CTrayWindow * TrayWindow = static_cast<CTrayWindow *>(Tray);
3408  return TrayWindow->RaiseStartButton();
3409 }
virtual HRESULT RaiseStartButton()
Definition: traywnd.cpp:3215

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

Definition at line 27 of file explorer.cpp.

Referenced by _tWinMain(), and DoStartStartupItems().

◆ CLSID_ITaskBand

const GUID CLSID_ITaskBand

◆ g_TaskbarSettings

◆ hExplorerInstance

◆ hkExplorer

◆ hProcessHeap

HANDLE hProcessHeap

Definition at line 25 of file kbswitch.c.

◆ IID_IShellDesktopTray

const GUID IID_IShellDesktopTray

Definition at line 136 of file traywnd.cpp.