ReactOS 0.4.15-dev-7674-gc0b4db1
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#define OEMRESOURCE
21
22#include <windef.h>
23#include <winbase.h>
24#include <winreg.h>
25#include <wingdi.h>
26#include <winnls.h>
27#include <wincon.h>
28#include <atlbase.h>
29#include <atlcom.h>
30#include <atlwin.h>
31#include <atlstr.h>
32#include <atlcoll.h>
33#include <atlsimpcoll.h>
34#include <shellapi.h>
35#include <shlobj.h>
36#include <shlwapi.h>
37#include <uxtheme.h>
38#include <process.h>
39#include <strsafe.h>
40
41#include <undocuser.h>
42#include <shlwapi_undoc.h>
43#include <shlobj_undoc.h>
44#include <shlguid_undoc.h>
45#include <undocshell.h>
46
47#include <ui/rosctrls.h>
48#include <ui/rosdlgs.h>
49#include <shellutils.h>
50
51#include "tmschema.h"
52#include "resource.h"
53
54#include <wine/debug.h>
55
57
58#define ASSERT(cond) \
59 do if (!(cond)) { \
60 Win32DbgPrint(__FILE__, __LINE__, "ASSERTION %s FAILED!\n", #cond); \
61 } while (0)
62
64extern HANDLE hProcessHeap;
65extern HKEY hkExplorer;
67
68/*
69 * explorer.c
70 */
71
72static inline
73LONG
75 IN LONG dwStyleMask,
76 IN LONG dwStyle)
77{
78 return SHSetWindowBits(hWnd, GWL_STYLE, dwStyleMask, dwStyle);
79}
80
81static inline
82LONG
84 IN LONG dwStyleMask,
85 IN LONG dwStyle)
86{
87 return SHSetWindowBits(hWnd, GWL_EXSTYLE, dwStyleMask, dwStyle);
88}
89
92 IN LPCWSTR lpMenuName);
93
95FindSubMenu(IN HMENU hMenu,
96 IN UINT uItem,
97 IN BOOL fByPosition);
98
99BOOL
101 IN DWORD dwBufferSize);
102
103BOOL
105 IN UINT uPosition,
106 IN UINT uFlags,
107 ...);
108
109BOOL
111 IN LPCWSTR lpSubKey,
112 IN LPCWSTR lpValue);
113
114/*
115 * rshell.c
116 */
117
120HANDLE WINAPI _SHCreateDesktop(IShellDesktopTray *ShellDesk);
123void WINAPI _ShellDDEInit(BOOL bInit);
126
127/*
128 * traywnd.c
129 */
130
131#define TWM_GETTASKSWITCH (WM_USER + 236)
132#define TWM_OPENSTARTMENU (WM_USER + 260)
133#define TWM_SETTINGSCHANGED (WM_USER + 300)
134#define TWM_PULSE (WM_USER + 400)
135
136extern const GUID IID_IShellDesktopTray;
137
138#define INTERFACE ITrayWindow
140{
141 /*** IUnknown methods ***/
145 /*** ITrayWindow methods ***/
148 STDMETHOD_(HWND, GetHWND) (THIS) PURE;
149 STDMETHOD_(BOOL, IsSpecialHWND) (THIS_ HWND hWnd) PURE;
150 STDMETHOD_(BOOL, IsHorizontal) (THIS) PURE;
151 STDMETHOD_(HWND, DisplayProperties) (THIS) PURE;
152 STDMETHOD_(BOOL, ExecContextMenuCmd) (THIS_ UINT uiCmd) PURE;
153 STDMETHOD_(BOOL, Lock) (THIS_ BOOL bLock) PURE;
154 STDMETHOD_(BOOL, IsTaskWnd) (THIS_ HWND hWnd) PURE;
155};
156#undef INTERFACE
157
158#if defined(COBJMACROS)
159/*** IUnknown methods ***/
160#define ITrayWindow_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
161#define ITrayWindow_AddRef(p) (p)->lpVtbl->AddRef(p)
162#define ITrayWindow_Release(p) (p)->lpVtbl->Release(p)
163/*** ITrayWindow methods ***/
164#define ITrayWindow_Open(p) (p)->lpVtbl->Open(p)
165#define ITrayWindow_Close(p) (p)->lpVtbl->Close(p)
166#define ITrayWindow_GetHWND(p) (p)->lpVtbl->GetHWND(p)
167#define ITrayWindow_IsSpecialHWND(p,a) (p)->lpVtbl->IsSpecialHWND(p,a)
168#define ITrayWindow_IsHorizontal(p) (p)->lpVtbl->IsHorizontal(p)
169#define ITrayWindow_DisplayProperties(p) (p)->lpVtbl->DisplayProperties(p)
170#define ITrayWindow_ExecContextMenuCmd(p,a) (p)->lpVtbl->ExecContextMenuCmd(p,a)
171#define ITrayWindow_Lock(p,a) (p)->lpVtbl->Lock(p,a)
172#define ITrayWindow_IsTaskWnd(p,a) (p)->lpVtbl->IsTaskWnd(p,a)
173#endif
174
175HRESULT CreateTrayWindow(ITrayWindow ** ppTray);
176
177VOID
178TrayProcessMessages(IN OUT ITrayWindow *Tray);
179
180VOID
181TrayMessageLoop(IN OUT ITrayWindow *Tray);
182
183/*
184 * settings.c
185 */
186
188{
194
195typedef struct _TW_STUCKRECTS2
196{
199 union
200 {
202 struct
203 {
208 };
209 };
214
216{
226
227 BOOL Load();
228 BOOL Save();
230 {
231 switch (eCompactTrayIcons)
232 {
233 case TIM_NeverCompact:
234 return FALSE;
236 return TRUE;
237 default:
238 return bSmallIcons;
239 }
240 }
241};
242
244
245/*
246 * shellservice.cpp
247 */
250
251/*
252 * startup.cpp
253 */
254
255BOOL DoStartStartupItems(ITrayWindow *Tray);
258
259/*
260 * trayprop.h
261 */
262
263VOID
264DisplayTrayProperties(IN HWND hwndOwner, IN HWND hwndTaskbar);
265
266/*
267 * desktop.cpp
268 */
269HANDLE
270DesktopCreateWindow(IN OUT ITrayWindow *Tray);
271
272VOID
274
275
276/*
277 * notifyiconscust.cpp
278 */
279VOID
281
282/*
283 * taskband.cpp
284 */
285
286extern const GUID CLSID_ITaskBand; /* Internal Task Band CLSID */
287HRESULT CTaskBand_CreateInstance(IN ITrayWindow *Tray, HWND hWndStartButton, REFIID riid, void **ppv);
288
289/*
290 * tbsite.cpp
291 */
292
293#define INTERFACE ITrayBandSite
295{
296 /*** IUnknown methods ***/
300 /*** IBandSiteStreamCallback ***/
301 STDMETHOD_(HRESULT, OnLoad)(THIS_ IStream *pStm, REFIID riid, PVOID *pvObj) PURE;
302 STDMETHOD_(HRESULT, OnSave)(THIS_ IUnknown *pUnk, IStream *pStm) PURE;
303 /*** ITrayBandSite methods ***/
304 STDMETHOD_(HRESULT, IsTaskBand) (THIS_ IUnknown *punk) PURE;
305 STDMETHOD_(HRESULT, ProcessMessage) (THIS_ HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult) PURE;
306 STDMETHOD_(HRESULT, AddContextMenus) (THIS_ HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags, IContextMenu **ppcm) PURE;
308};
309#undef INTERFACE
310
311#if defined(COBJMACROS)
312/*** IUnknown methods ***/
313#define ITrayBandSite_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
314#define ITrayBandSite_AddRef(p) (p)->lpVtbl->AddRef(p)
315#define ITrayBandSite_Release(p) (p)->lpVtbl->Release(p)
316/*** IBandSiteStreamCallback methods ***/
317#define ITrayBandSite_OnLoad(p,a,b,c) (p)->lpVtbl->OnLoad(p,a,b,c)
318#define ITrayBandSite_OnSave(p,a,b) (p)->lpVtbl->OnSave(p,a,b)
319/*** ITrayBandSite methods ***/
320#define ITrayBandSite_IsTaskBand(p,a) (p)->lpVtbl->IsTaskBand(p,a)
321#define ITrayBandSite_ProcessMessage(p,a,b,c,d,e) (p)->lpVtbl->ProcessMessage(p,a,b,c,d,e)
322#define ITrayBandSite_AddContextMenus(p,a,b,c,d,e,f) (p)->lpVtbl->AddContextMenus(p,a,b,c,d,e,f)
323#define ITrayBandSite_Lock(p,a) (p)->lpVtbl->Lock(p,a)
324#endif
325
326HRESULT CTrayBandSite_CreateInstance(IN ITrayWindow *tray, IN IDeskBand* pTaskBand, OUT ITrayBandSite** pBandSite);
327
328/*
329 * startmnu.cpp
330 */
331
332HRESULT CStartMenuBtnCtxMenu_CreateInstance(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu);
333
335CreateStartMenu(IN ITrayWindow *Tray,
336 OUT IMenuBand **ppMenuBand,
337 IN HBITMAP hbmBanner OPTIONAL,
338 IN BOOL bSmallIcons);
339
340/*
341 * startmnucust.cpp
342 */
343VOID
345
346/*
347* startmnusite.cpp
348*/
349
351CStartMenuSite_CreateInstance(IN OUT ITrayWindow *Tray, const IID & riid, PVOID * ppv);
352
353/*
354 * trayntfy.c
355 */
356
357/* TrayClockWnd */
359
360/* TrayNotifyWnd */
361#define TNWM_GETMINIMUMSIZE (WM_USER + 0x100)
362#define TNWM_CHANGETRAYPOS (WM_USER + 0x104)
363
364#define NTNWM_REALIGN (0x1)
365
367
368/* SysPagerWnd */
370
371/*
372 * taskswnd.c
373 */
374
375#define TSWM_UPDATETASKBARPOS (WM_USER + 2)
376
378
380Tray_OnStartMenuDismissed(ITrayWindow* Tray);
381
383IsSameObject(IN IUnknown *punk1, IN IUnknown *punk2);
384
385#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:344
const GUID IID_IShellDesktopTray
Definition: traywnd.cpp:191
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:779
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:1611
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:2026
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
TrayIconsMode
Definition: precomp.h:188
@ TIM_AlwaysCompact
Definition: precomp.h:191
@ TIM_NeverCompact
Definition: precomp.h:190
@ TIM_Max
Definition: precomp.h:192
@ TIM_Default
Definition: precomp.h:189
HRESULT Tray_OnStartMenuDismissed(ITrayWindow *Tray)
Definition: traywnd.cpp:3875
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:3860
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:43
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
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
UINT uFlags
Definition: api.c:59
LONG WINAPI SHSetWindowBits(HWND hwnd, INT offset, UINT mask, UINT flags)
Definition: ordinal.c:1126
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:63
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:218
BOOL bShowDesktopButton
Definition: precomp.h:224
BOOL bHideInactiveIcons
Definition: precomp.h:221
TW_STRUCKRECTS2 sr
Definition: precomp.h:225
BOOL bShowSeconds
Definition: precomp.h:219
TrayIconsMode eCompactTrayIcons
Definition: precomp.h:223
BOOL UseCompactTrayIcons()
Definition: precomp.h:229
BOOL bPreferDate
Definition: precomp.h:220
BOOL bSmallIcons
Definition: precomp.h:222
Definition: dpa.c:49
DWORD SmallIcons
Definition: precomp.h:206
DWORD AutoHide
Definition: precomp.h:204
DWORD HideClock
Definition: precomp.h:207
DWORD AlwaysOnTop
Definition: precomp.h:205
DWORD dwFlags
Definition: precomp.h:201
DWORD Position
Definition: precomp.h:210
DWORD cbSize
Definition: precomp.h:197
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:851
#define GWL_EXSTYLE
Definition: winuser.h:850
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185