ReactOS 0.4.15-dev-5893-g1bb4167
precomp.h
Go to the documentation of this file.
1#ifndef _EXPLORER_PRECOMP__H_
2#define _EXPLORER_PRECOMP__H_
3
4#define WIN7_COMPAT_MODE 0
5#define WIN7_DEBUG_MODE 0
6
7#if WIN7_DEBUG_MODE && !WIN7_COMPAT_MODE
8#undef WIN7_COMPAT_MODE
9#define WIN7_COMPAT_MODE 1
10#endif
11
12#include <stdio.h>
13#include <tchar.h>
14
15#define WIN32_NO_STATUS
16#define _INC_WINDOWS
17#define COM_NO_WINDOWS_H
18
19#define COBJMACROS
20
21#include <windef.h>
22#include <winbase.h>
23#include <winreg.h>
24#include <wingdi.h>
25#include <winnls.h>
26#include <wincon.h>
27#include <atlbase.h>
28#include <atlcom.h>
29#include <atlwin.h>
30#include <atlstr.h>
31#include <atlcoll.h>
32#include <atlsimpcoll.h>
33#include <shellapi.h>
34#include <shlobj.h>
35#include <shlwapi.h>
36#include <uxtheme.h>
37#include <process.h>
38#include <strsafe.h>
39
40#include <undocuser.h>
41#include <shlwapi_undoc.h>
42#include <shlobj_undoc.h>
43#include <shlguid_undoc.h>
44#include <undocshell.h>
45
46#include <ui/rosctrls.h>
47#include <ui/rosdlgs.h>
48#include <shellutils.h>
49
50#include "tmschema.h"
51#include "resource.h"
52
53#include <wine/debug.h>
54
56
57#define ASSERT(cond) \
58 do if (!(cond)) { \
59 Win32DbgPrint(__FILE__, __LINE__, "ASSERTION %s FAILED!\n", #cond); \
60 } while (0)
61
63extern HANDLE hProcessHeap;
64extern HKEY hkExplorer;
66
67/*
68 * explorer.c
69 */
70
71static inline
72LONG
74 IN LONG dwStyleMask,
75 IN LONG dwStyle)
76{
77 return SHSetWindowBits(hWnd, GWL_STYLE, dwStyleMask, dwStyle);
78}
79
80static inline
81LONG
83 IN LONG dwStyleMask,
84 IN LONG dwStyle)
85{
86 return SHSetWindowBits(hWnd, GWL_EXSTYLE, dwStyleMask, dwStyle);
87}
88
91 IN LPCWSTR lpMenuName);
92
94FindSubMenu(IN HMENU hMenu,
95 IN UINT uItem,
96 IN BOOL fByPosition);
97
98BOOL
100 IN DWORD dwBufferSize);
101
102BOOL
104 IN UINT uPosition,
105 IN UINT uFlags,
106 ...);
107
108BOOL
110 IN LPCWSTR lpSubKey,
111 IN LPCWSTR lpValue);
112
113/*
114 * rshell.c
115 */
116
119HANDLE WINAPI _SHCreateDesktop(IShellDesktopTray *ShellDesk);
122void WINAPI _ShellDDEInit(BOOL bInit);
125
126/*
127 * traywnd.c
128 */
129
130#define TWM_GETTASKSWITCH (WM_USER + 236)
131#define TWM_OPENSTARTMENU (WM_USER + 260)
132#define TWM_SETTINGSCHANGED (WM_USER + 300)
133
134extern const GUID IID_IShellDesktopTray;
135
136#define INTERFACE ITrayWindow
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};
153#undef INTERFACE
154
155#if defined(COBJMACROS)
156/*** IUnknown methods ***/
157#define ITrayWindow_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
158#define ITrayWindow_AddRef(p) (p)->lpVtbl->AddRef(p)
159#define ITrayWindow_Release(p) (p)->lpVtbl->Release(p)
160/*** ITrayWindow methods ***/
161#define ITrayWindow_Open(p) (p)->lpVtbl->Open(p)
162#define ITrayWindow_Close(p) (p)->lpVtbl->Close(p)
163#define ITrayWindow_GetHWND(p) (p)->lpVtbl->GetHWND(p)
164#define ITrayWindow_IsSpecialHWND(p,a) (p)->lpVtbl->IsSpecialHWND(p,a)
165#define ITrayWindow_IsHorizontal(p) (p)->lpVtbl->IsHorizontal(p)
166#define ITrayWindow_DisplayProperties(p) (p)->lpVtbl->DisplayProperties(p)
167#define ITrayWindow_ExecContextMenuCmd(p,a) (p)->lpVtbl->ExecContextMenuCmd(p,a)
168#define ITrayWindow_Lock(p,a) (p)->lpVtbl->Lock(p,a)
169#endif
170
171HRESULT CreateTrayWindow(ITrayWindow ** ppTray);
172
173VOID
174TrayProcessMessages(IN OUT ITrayWindow *Tray);
175
176VOID
177TrayMessageLoop(IN OUT ITrayWindow *Tray);
178
179/*
180 * settings.c
181 */
182
183typedef struct _TW_STUCKRECTS2
184{
187 union
188 {
190 struct
191 {
196 };
197 };
202
204{
210
211 BOOL Load();
212 BOOL Save();
213};
214
216
217/*
218 * shellservice.cpp
219 */
222
223/*
224 * startup.cpp
225 */
226
227BOOL DoStartStartupItems(ITrayWindow *Tray);
230
231/*
232 * trayprop.h
233 */
234
235VOID
236DisplayTrayProperties(IN HWND hwndOwner, IN HWND hwndTaskbar);
237
238/*
239 * desktop.cpp
240 */
241HANDLE
242DesktopCreateWindow(IN OUT ITrayWindow *Tray);
243
244VOID
246
247
248/*
249 * notifyiconscust.cpp
250 */
251VOID
253
254/*
255 * taskband.cpp
256 */
257
258extern const GUID CLSID_ITaskBand; /* Internal Task Band CLSID */
259HRESULT CTaskBand_CreateInstance(IN ITrayWindow *Tray, HWND hWndStartButton, REFIID riid, void **ppv);
260
261/*
262 * tbsite.cpp
263 */
264
265#define INTERFACE ITrayBandSite
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;
280};
281#undef INTERFACE
282
283#if defined(COBJMACROS)
284/*** IUnknown methods ***/
285#define ITrayBandSite_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
286#define ITrayBandSite_AddRef(p) (p)->lpVtbl->AddRef(p)
287#define ITrayBandSite_Release(p) (p)->lpVtbl->Release(p)
288/*** IBandSiteStreamCallback methods ***/
289#define ITrayBandSite_OnLoad(p,a,b,c) (p)->lpVtbl->OnLoad(p,a,b,c)
290#define ITrayBandSite_OnSave(p,a,b) (p)->lpVtbl->OnSave(p,a,b)
291/*** ITrayBandSite methods ***/
292#define ITrayBandSite_IsTaskBand(p,a) (p)->lpVtbl->IsTaskBand(p,a)
293#define ITrayBandSite_ProcessMessage(p,a,b,c,d,e) (p)->lpVtbl->ProcessMessage(p,a,b,c,d,e)
294#define ITrayBandSite_AddContextMenus(p,a,b,c,d,e,f) (p)->lpVtbl->AddContextMenus(p,a,b,c,d,e,f)
295#define ITrayBandSite_Lock(p,a) (p)->lpVtbl->Lock(p,a)
296#endif
297
298HRESULT CTrayBandSite_CreateInstance(IN ITrayWindow *tray, IN IDeskBand* pTaskBand, OUT ITrayBandSite** pBandSite);
299
300/*
301 * startmnu.cpp
302 */
303
304HRESULT CStartMenuBtnCtxMenu_CreateInstance(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu);
305
307CreateStartMenu(IN ITrayWindow *Tray,
308 OUT IMenuBand **ppMenuBand,
309 IN HBITMAP hbmBanner OPTIONAL,
310 IN BOOL bSmallIcons);
311
312/*
313 * startmnucust.cpp
314 */
315VOID
317
318/*
319* startmnusite.cpp
320*/
321
323CStartMenuSite_CreateInstance(IN OUT ITrayWindow *Tray, const IID & riid, PVOID * ppv);
324
325/*
326 * trayntfy.c
327 */
328
329/* TrayClockWnd */
331
332/* TrayNotifyWnd */
333#define TNWM_GETMINIMUMSIZE (WM_USER + 0x100)
334#define TNWM_CHANGETRAYPOS (WM_USER + 0x104)
335
336#define NTNWM_REALIGN (0x1)
337
339
340/* SysPagerWnd */
342
343/*
344 * taskswnd.c
345 */
346
347#define TSWM_UPDATETASKBARPOS (WM_USER + 2)
348
350
352Tray_OnStartMenuDismissed(ITrayWindow* Tray);
353
355IsSameObject(IN IUnknown *punk1, IN IUnknown *punk2);
356
357#endif /* _EXPLORER_PRECOMP__H_ */
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
VOID DisplayTrayProperties(IN HWND hwndOwner, IN HWND hwndTaskbar)
Definition: trayprop.cpp:291
const GUID IID_IShellDesktopTray
Definition: traywnd.cpp:178
HMENU FindSubMenu(IN HMENU hMenu, IN UINT uItem, IN BOOL fByPosition)
Definition: util.cpp:55
VOID DesktopDestroyShellWindow(IN HANDLE hDesktop)
Definition: desktop.cpp:203
HRESULT CTrayClockWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: trayclock.cpp:747
BOOL FormatMenuString(IN HMENU hMenu, IN UINT uPosition, IN UINT uFlags,...)
Definition: util.cpp:106
HRESULT CSysPagerWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: syspager.cpp:1584
struct _TW_STUCKRECTS2 TW_STRUCKRECTS2
INT ProcessStartupItems(VOID)
Definition: startup.cpp:453
VOID TrayMessageLoop(IN OUT ITrayWindow *Tray)
HRESULT WINAPI _CBandSite_CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, void **ppv)
Definition: rshell.cpp:186
HRESULT CStartMenuBtnCtxMenu_CreateInstance(ITrayWindow *TrayWnd, IN HWND hWndOwner, IContextMenu **ppCtxMenu)
HRESULT CTaskSwitchWnd_CreateInstance(IN HWND hWndParent, IN OUT ITrayWindow *Tray, REFIID riid, void **ppv)
Definition: taskswnd.cpp:2007
HMENU LoadPopupMenu(IN HINSTANCE hInstance, IN LPCWSTR lpMenuName)
Definition: util.cpp:33
VOID TrayProcessMessages(IN OUT ITrayWindow *Tray)
BOOL WINAPI _SHDesktopMessageLoop(HANDLE hDesktop)
Definition: rshell.cpp:81
IMenuPopup * CreateStartMenu(IN ITrayWindow *Tray, OUT IMenuBand **ppMenuBand, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons)
Definition: startmnu.cpp:44
HRESULT CStartMenuSite_CreateInstance(IN OUT ITrayWindow *Tray, const IID &riid, PVOID *ppv)
HRESULT WINAPI _CBandSiteMenu_CreateInstance(REFIID riid, void **ppv)
Definition: rshell.cpp:167
HRESULT Tray_OnStartMenuDismissed(ITrayWindow *Tray)
Definition: traywnd.cpp:3792
void WINAPI _ShellDDEInit(BOOL bInit)
Definition: rshell.cpp:139
DWORD WINAPI _WinList_Init(void)
Definition: rshell.cpp:110
HRESULT CreateTrayWindow(ITrayWindow **ppTray)
Definition: traywnd.cpp:3777
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
VOID ShowCustomizeClassic(HINSTANCE, HWND)
HANDLE DesktopCreateWindow(IN OUT ITrayWindow *Tray)
Definition: desktop.cpp:188
BOOL GetCurrentLoggedOnUserName(OUT LPWSTR szBuffer, IN DWORD dwBufferSize)
Definition: util.cpp:73
HRESULT CTrayNotifyWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: trayntfy.cpp:372
struct _TW_STUCKRECTS2 * PTW_STUCKRECTS2
HRESULT CTrayBandSite_CreateInstance(IN ITrayWindow *tray, IN IDeskBand *pTaskBand, OUT ITrayBandSite **pBandSite)
Definition: tbsite.cpp:715
BOOL bExplorerIsShell
Definition: explorer.cpp:27
HRESULT IsSameObject(IN IUnknown *punk1, IN IUnknown *punk2)
Definition: util.cpp:11
HANDLE WINAPI _SHCreateDesktop(IShellDesktopTray *ShellDesk)
Definition: rshell.cpp:52
BOOL GetExplorerRegValueSet(IN HKEY hKey, IN LPCWSTR lpSubKey, IN LPCWSTR lpValue)
Definition: util.cpp:144
const GUID CLSID_ITaskBand
Definition: taskband.cpp:27
VOID InitRSHELL(VOID)
Definition: rshell.cpp:27
VOID ShowCustomizeNotifyIcons(HINSTANCE, HWND)
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
HRESULT InitShellServices(HDPA *phdpa)
BOOL DoStartStartupItems(ITrayWindow *Tray)
Definition: startup.cpp:519
HKEY hkExplorer
Definition: explorer.cpp:26
HRESULT CTaskBand_CreateInstance(IN ITrayWindow *Tray, HWND hWndStartButton, REFIID riid, void **ppv)
Definition: taskband.cpp:346
HRESULT ShutdownShellServices(HDPA hdpa)
HANDLE hProcessHeap
Definition: kbswitch.c:34
BOOL DoFinishStartupItems(VOID)
Definition: startup.cpp:508
HRESULT WINAPI _CStartMenu_CreateInstance(REFIID riid, void **ppv)
Definition: rshell.cpp:32
#define DECLARE_INTERFACE_(i, b)
Definition: basetyps.h:78
#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
HINSTANCE hInstance
Definition: charmap.c:19
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static HWND hwndParent
Definition: cryptui.c:300
UINT uFlags
Definition: api.c:59
LONG WINAPI SHSetWindowBits(HWND hwnd, INT offset, UINT mask, UINT flags)
Definition: ordinal.c:1123
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define Open
Definition: syshdrs.h:62
#define SetWindowStyle(hwnd, val)
Definition: utility.h:153
#define SetWindowExStyle(h, val)
Definition: utility.h:154
static HBITMAP
Definition: button.c:44
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
static LPUNKNOWN
Definition: ndr_ole.c:49
long LONG
Definition: pedump.c:60
#define REFIID
Definition: guiddef.h:118
@ Close
Definition: sacdrv.h:268
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
BOOL bGroupButtons
Definition: precomp.h:206
BOOL bHideInactiveIcons
Definition: precomp.h:208
TW_STRUCKRECTS2 sr
Definition: precomp.h:209
BOOL bShowSeconds
Definition: precomp.h:207
Definition: dpa.c:49
DWORD SmallIcons
Definition: precomp.h:194
DWORD AutoHide
Definition: precomp.h:192
DWORD HideClock
Definition: precomp.h:195
DWORD AlwaysOnTop
Definition: precomp.h:193
DWORD dwFlags
Definition: precomp.h:189
DWORD Position
Definition: precomp.h:198
DWORD cbSize
Definition: precomp.h:185
int32_t INT
Definition: typedefs.h:58
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_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
#define WINAPI
Definition: msvc.h:6
#define GWL_STYLE
Definition: winuser.h:846
#define GWL_EXSTYLE
Definition: winuser.h:845
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185