1c2c66affSColin Finck #ifndef _EXPLORER_PRECOMP__H_ 2c2c66affSColin Finck #define _EXPLORER_PRECOMP__H_ 3c2c66affSColin Finck 4c2c66affSColin Finck #define WIN7_COMPAT_MODE 0 5c2c66affSColin Finck #define WIN7_DEBUG_MODE 0 6c2c66affSColin Finck 7c2c66affSColin Finck #if WIN7_DEBUG_MODE && !WIN7_COMPAT_MODE 8c2c66affSColin Finck #undef WIN7_COMPAT_MODE 9c2c66affSColin Finck #define WIN7_COMPAT_MODE 1 10c2c66affSColin Finck #endif 11c2c66affSColin Finck 12c2c66affSColin Finck #include <stdio.h> 13c2c66affSColin Finck #include <tchar.h> 14c2c66affSColin Finck 15c2c66affSColin Finck #define WIN32_NO_STATUS 16c2c66affSColin Finck #define _INC_WINDOWS 17c2c66affSColin Finck #define COM_NO_WINDOWS_H 18c2c66affSColin Finck 19c2c66affSColin Finck #define COBJMACROS 20c2c66affSColin Finck 21c2c66affSColin Finck #include <windef.h> 22c2c66affSColin Finck #include <winbase.h> 23c2c66affSColin Finck #include <winreg.h> 24c2c66affSColin Finck #include <wingdi.h> 25c2c66affSColin Finck #include <winnls.h> 26c2c66affSColin Finck #include <wincon.h> 27c2c66affSColin Finck #include <atlbase.h> 28c2c66affSColin Finck #include <atlcom.h> 29c2c66affSColin Finck #include <atlwin.h> 302ed535daSGiannis Adamopoulos #include <atlstr.h> 31d66c6890Sgedmurphy #include <atlcoll.h> 32c2c66affSColin Finck #include <shellapi.h> 33c2c66affSColin Finck #include <shlobj.h> 34c2c66affSColin Finck #include <shlwapi.h> 35c2c66affSColin Finck #include <uxtheme.h> 36d66c6890Sgedmurphy #include <process.h> 37c2c66affSColin Finck #include <strsafe.h> 38c2c66affSColin Finck 39c2c66affSColin Finck #include <undocuser.h> 40c2c66affSColin Finck #include <shlwapi_undoc.h> 41c2c66affSColin Finck #include <shlobj_undoc.h> 42c2c66affSColin Finck #include <shlguid_undoc.h> 43c2c66affSColin Finck #include <undocshell.h> 44c2c66affSColin Finck 45c2c66affSColin Finck #include <rosctrls.h> 462ed535daSGiannis Adamopoulos #include <rosdlgs.h> 47c2c66affSColin Finck #include <shellutils.h> 48c2c66affSColin Finck 49c2c66affSColin Finck #include "tmschema.h" 50c2c66affSColin Finck #include "resource.h" 51c2c66affSColin Finck 52c2c66affSColin Finck #include <wine/debug.h> 53c2c66affSColin Finck 54c2c66affSColin Finck WINE_DEFAULT_DEBUG_CHANNEL(explorernew); 55c2c66affSColin Finck 56c2c66affSColin Finck #define ASSERT(cond) \ 57c2c66affSColin Finck do if (!(cond)) { \ 58c2c66affSColin Finck Win32DbgPrint(__FILE__, __LINE__, "ASSERTION %s FAILED!\n", #cond); \ 59c2c66affSColin Finck } while (0) 60c2c66affSColin Finck 61c2c66affSColin Finck extern HINSTANCE hExplorerInstance; 62c2c66affSColin Finck extern HANDLE hProcessHeap; 63c2c66affSColin Finck extern HKEY hkExplorer; 64c2c66affSColin Finck 65c2c66affSColin Finck #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) 66c2c66affSColin Finck #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) 67c2c66affSColin Finck 68c2c66affSColin Finck /* 69c2c66affSColin Finck * explorer.c 70c2c66affSColin Finck */ 71c2c66affSColin Finck 72c2c66affSColin Finck static inline 73c2c66affSColin Finck LONG 74c2c66affSColin Finck SetWindowStyle(IN HWND hWnd, 75c2c66affSColin Finck IN LONG dwStyleMask, 76c2c66affSColin Finck IN LONG dwStyle) 77c2c66affSColin Finck { 78c2c66affSColin Finck return SHSetWindowBits(hWnd, GWL_STYLE, dwStyleMask, dwStyle); 79c2c66affSColin Finck } 80c2c66affSColin Finck 81c2c66affSColin Finck static inline 82c2c66affSColin Finck LONG 83c2c66affSColin Finck SetWindowExStyle(IN HWND hWnd, 84c2c66affSColin Finck IN LONG dwStyleMask, 85c2c66affSColin Finck IN LONG dwStyle) 86c2c66affSColin Finck { 87c2c66affSColin Finck return SHSetWindowBits(hWnd, GWL_EXSTYLE, dwStyleMask, dwStyle); 88c2c66affSColin Finck } 89c2c66affSColin Finck 90c2c66affSColin Finck HMENU 91c2c66affSColin Finck LoadPopupMenu(IN HINSTANCE hInstance, 92c2c66affSColin Finck IN LPCWSTR lpMenuName); 93c2c66affSColin Finck 94c2c66affSColin Finck HMENU 95c2c66affSColin Finck FindSubMenu(IN HMENU hMenu, 96c2c66affSColin Finck IN UINT uItem, 97c2c66affSColin Finck IN BOOL fByPosition); 98c2c66affSColin Finck 99c2c66affSColin Finck BOOL 100c2c66affSColin Finck GetCurrentLoggedOnUserName(OUT LPWSTR szBuffer, 101c2c66affSColin Finck IN DWORD dwBufferSize); 102c2c66affSColin Finck 103c2c66affSColin Finck BOOL 104c2c66affSColin Finck FormatMenuString(IN HMENU hMenu, 105c2c66affSColin Finck IN UINT uPosition, 106c2c66affSColin Finck IN UINT uFlags, 107c2c66affSColin Finck ...); 108c2c66affSColin Finck 109c2c66affSColin Finck BOOL 110c2c66affSColin Finck GetExplorerRegValueSet(IN HKEY hKey, 111c2c66affSColin Finck IN LPCWSTR lpSubKey, 112c2c66affSColin Finck IN LPCWSTR lpValue); 113c2c66affSColin Finck 114c2c66affSColin Finck /* 115c2c66affSColin Finck * rshell.c 116c2c66affSColin Finck */ 117c2c66affSColin Finck 118c2c66affSColin Finck VOID InitRSHELL(VOID); 119c2c66affSColin Finck HRESULT WINAPI _CStartMenu_CreateInstance(REFIID riid, void **ppv); 120c2c66affSColin Finck HANDLE WINAPI _SHCreateDesktop(IShellDesktopTray *ShellDesk); 121c2c66affSColin Finck BOOL WINAPI _SHDesktopMessageLoop(HANDLE hDesktop); 122c2c66affSColin Finck DWORD WINAPI _WinList_Init(void); 123c2c66affSColin Finck void WINAPI _ShellDDEInit(BOOL bInit); 124c2c66affSColin Finck HRESULT WINAPI _CBandSiteMenu_CreateInstance(REFIID riid, void **ppv); 125c2c66affSColin Finck HRESULT WINAPI _CBandSite_CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, void **ppv); 126c2c66affSColin Finck 127c2c66affSColin Finck /* 128c2c66affSColin Finck * traywnd.c 129c2c66affSColin Finck */ 130c2c66affSColin Finck 131c2c66affSColin Finck #define TWM_OPENSTARTMENU (WM_USER + 260) 1322ed535daSGiannis Adamopoulos #define TWM_SETTINGSCHANGED (WM_USER + 300) 133c2c66affSColin Finck 134c2c66affSColin Finck extern const GUID IID_IShellDesktopTray; 135c2c66affSColin Finck 136c2c66affSColin Finck #define INTERFACE ITrayWindow 137c2c66affSColin Finck DECLARE_INTERFACE_(ITrayWindow, IUnknown) 138c2c66affSColin Finck { 139c2c66affSColin Finck /*** IUnknown methods ***/ 140c2c66affSColin Finck STDMETHOD_(HRESULT, QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE; 141c2c66affSColin Finck STDMETHOD_(ULONG, AddRef) (THIS) PURE; 142c2c66affSColin Finck STDMETHOD_(ULONG, Release) (THIS) PURE; 143c2c66affSColin Finck /*** ITrayWindow methods ***/ 144c2c66affSColin Finck STDMETHOD_(HRESULT, Open) (THIS) PURE; 145c2c66affSColin Finck STDMETHOD_(HRESULT, Close) (THIS) PURE; 146c2c66affSColin Finck STDMETHOD_(HWND, GetHWND) (THIS) PURE; 147c2c66affSColin Finck STDMETHOD_(BOOL, IsSpecialHWND) (THIS_ HWND hWnd) PURE; 148c2c66affSColin Finck STDMETHOD_(BOOL, IsHorizontal) (THIS) PURE; 149c2c66affSColin Finck STDMETHOD_(HWND, DisplayProperties) (THIS) PURE; 150c2c66affSColin Finck STDMETHOD_(BOOL, ExecContextMenuCmd) (THIS_ UINT uiCmd) PURE; 151c2c66affSColin Finck STDMETHOD_(BOOL, Lock) (THIS_ BOOL bLock) PURE; 152c2c66affSColin Finck }; 153c2c66affSColin Finck #undef INTERFACE 154c2c66affSColin Finck 155c2c66affSColin Finck #if defined(COBJMACROS) 156c2c66affSColin Finck /*** IUnknown methods ***/ 157c2c66affSColin Finck #define ITrayWindow_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 158c2c66affSColin Finck #define ITrayWindow_AddRef(p) (p)->lpVtbl->AddRef(p) 159c2c66affSColin Finck #define ITrayWindow_Release(p) (p)->lpVtbl->Release(p) 160c2c66affSColin Finck /*** ITrayWindow methods ***/ 161c2c66affSColin Finck #define ITrayWindow_Open(p) (p)->lpVtbl->Open(p) 162c2c66affSColin Finck #define ITrayWindow_Close(p) (p)->lpVtbl->Close(p) 163c2c66affSColin Finck #define ITrayWindow_GetHWND(p) (p)->lpVtbl->GetHWND(p) 164c2c66affSColin Finck #define ITrayWindow_IsSpecialHWND(p,a) (p)->lpVtbl->IsSpecialHWND(p,a) 165c2c66affSColin Finck #define ITrayWindow_IsHorizontal(p) (p)->lpVtbl->IsHorizontal(p) 166c2c66affSColin Finck #define ITrayWindow_DisplayProperties(p) (p)->lpVtbl->DisplayProperties(p) 167c2c66affSColin Finck #define ITrayWindow_ExecContextMenuCmd(p,a) (p)->lpVtbl->ExecContextMenuCmd(p,a) 168c2c66affSColin Finck #define ITrayWindow_Lock(p,a) (p)->lpVtbl->Lock(p,a) 169c2c66affSColin Finck #endif 170c2c66affSColin Finck 171c2c66affSColin Finck BOOL 172c2c66affSColin Finck RegisterTrayWindowClass(VOID); 173c2c66affSColin Finck 174c2c66affSColin Finck VOID 175c2c66affSColin Finck UnregisterTrayWindowClass(VOID); 176c2c66affSColin Finck 177c2c66affSColin Finck HRESULT CreateTrayWindow(ITrayWindow ** ppTray); 178c2c66affSColin Finck 179c2c66affSColin Finck VOID 180c2c66affSColin Finck TrayProcessMessages(IN OUT ITrayWindow *Tray); 181c2c66affSColin Finck 182c2c66affSColin Finck VOID 183c2c66affSColin Finck TrayMessageLoop(IN OUT ITrayWindow *Tray); 184c2c66affSColin Finck 185c2c66affSColin Finck /* 186c2c66affSColin Finck * settings.c 187c2c66affSColin Finck */ 188c2c66affSColin Finck 1892ed535daSGiannis Adamopoulos typedef struct _TW_STUCKRECTS2 1902ed535daSGiannis Adamopoulos { 1912ed535daSGiannis Adamopoulos DWORD cbSize; 1922ed535daSGiannis Adamopoulos LONG Unknown; 1932ed535daSGiannis Adamopoulos union 1942ed535daSGiannis Adamopoulos { 1952ed535daSGiannis Adamopoulos DWORD dwFlags; 1962ed535daSGiannis Adamopoulos struct 1972ed535daSGiannis Adamopoulos { 1982ed535daSGiannis Adamopoulos DWORD AutoHide : 1; 1992ed535daSGiannis Adamopoulos DWORD AlwaysOnTop : 1; 2002ed535daSGiannis Adamopoulos DWORD SmallIcons : 1; 2012ed535daSGiannis Adamopoulos DWORD HideClock : 1; 2022ed535daSGiannis Adamopoulos }; 2032ed535daSGiannis Adamopoulos }; 2042ed535daSGiannis Adamopoulos DWORD Position; 2052ed535daSGiannis Adamopoulos SIZE Size; 2062ed535daSGiannis Adamopoulos RECT Rect; 2072ed535daSGiannis Adamopoulos } TW_STRUCKRECTS2, *PTW_STUCKRECTS2; 2082ed535daSGiannis Adamopoulos 2092ed535daSGiannis Adamopoulos struct TaskbarSettings 210c2c66affSColin Finck { 211c2c66affSColin Finck BOOL bLock; 212c2c66affSColin Finck BOOL bGroupButtons; 213c2c66affSColin Finck BOOL bShowSeconds; 214c2c66affSColin Finck BOOL bHideInactiveIcons; 2152ed535daSGiannis Adamopoulos TW_STRUCKRECTS2 sr; 216c2c66affSColin Finck 2172ed535daSGiannis Adamopoulos BOOL Load(); 2182ed535daSGiannis Adamopoulos BOOL Save(); 2192ed535daSGiannis Adamopoulos }; 220c2c66affSColin Finck 2212ed535daSGiannis Adamopoulos extern TaskbarSettings g_TaskbarSettings; 222c2c66affSColin Finck 223c2c66affSColin Finck /* 224c2c66affSColin Finck * shellservice.cpp 225c2c66affSColin Finck */ 226c2c66affSColin Finck HRESULT InitShellServices(HDPA * phdpa); 227c2c66affSColin Finck HRESULT ShutdownShellServices(HDPA hdpa); 228c2c66affSColin Finck 229c2c66affSColin Finck /* 230c2c66affSColin Finck * startup.cpp 231c2c66affSColin Finck */ 232c2c66affSColin Finck 233*0a8cd95cSKatayama Hirofumi MZ BOOL DoStartStartupItems(ITrayWindow *Tray); 234*0a8cd95cSKatayama Hirofumi MZ INT ProcessStartupItems(VOID); 235*0a8cd95cSKatayama Hirofumi MZ BOOL DoFinishStartupItems(VOID); 236c2c66affSColin Finck 237c2c66affSColin Finck /* 238c2c66affSColin Finck * trayprop.h 239c2c66affSColin Finck */ 240c2c66affSColin Finck 241c2c66affSColin Finck VOID 2422ed535daSGiannis Adamopoulos DisplayTrayProperties(IN HWND hwndOwner, IN HWND hwndTaskbar); 243c2c66affSColin Finck 244c2c66affSColin Finck /* 245c2c66affSColin Finck * desktop.cpp 246c2c66affSColin Finck */ 247c2c66affSColin Finck HANDLE 248c2c66affSColin Finck DesktopCreateWindow(IN OUT ITrayWindow *Tray); 249c2c66affSColin Finck 250c2c66affSColin Finck VOID 251c2c66affSColin Finck DesktopDestroyShellWindow(IN HANDLE hDesktop); 252c2c66affSColin Finck 253c2c66affSColin Finck 254c2c66affSColin Finck /* 255c2c66affSColin Finck * notifyiconscust.cpp 256c2c66affSColin Finck */ 257c2c66affSColin Finck VOID 258c2c66affSColin Finck ShowCustomizeNotifyIcons(HINSTANCE, HWND); 259c2c66affSColin Finck 260c2c66affSColin Finck /* 261c2c66affSColin Finck * taskband.cpp 262c2c66affSColin Finck */ 263c2c66affSColin Finck 264c2c66affSColin Finck extern const GUID CLSID_ITaskBand; /* Internal Task Band CLSID */ 265c2c66affSColin Finck HRESULT CTaskBand_CreateInstance(IN ITrayWindow *Tray, HWND hWndStartButton, REFIID riid, void **ppv); 266c2c66affSColin Finck 267c2c66affSColin Finck /* 268c2c66affSColin Finck * tbsite.cpp 269c2c66affSColin Finck */ 270c2c66affSColin Finck 271c2c66affSColin Finck #define INTERFACE ITrayBandSite 272c2c66affSColin Finck DECLARE_INTERFACE_(ITrayBandSite, IUnknown) 273c2c66affSColin Finck { 274c2c66affSColin Finck /*** IUnknown methods ***/ 275c2c66affSColin Finck STDMETHOD_(HRESULT, QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE; 276c2c66affSColin Finck STDMETHOD_(ULONG, AddRef) (THIS) PURE; 277c2c66affSColin Finck STDMETHOD_(ULONG, Release) (THIS) PURE; 278c2c66affSColin Finck /*** IBandSiteStreamCallback ***/ 279c2c66affSColin Finck STDMETHOD_(HRESULT, OnLoad)(THIS_ IStream *pStm, REFIID riid, PVOID *pvObj) PURE; 280c2c66affSColin Finck STDMETHOD_(HRESULT, OnSave)(THIS_ IUnknown *pUnk, IStream *pStm) PURE; 281c2c66affSColin Finck /*** ITrayBandSite methods ***/ 282c2c66affSColin Finck STDMETHOD_(HRESULT, IsTaskBand) (THIS_ IUnknown *punk) PURE; 283c2c66affSColin Finck STDMETHOD_(HRESULT, ProcessMessage) (THIS_ HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult) PURE; 284c2c66affSColin Finck STDMETHOD_(HRESULT, AddContextMenus) (THIS_ HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags, IContextMenu **ppcm) PURE; 285c2c66affSColin Finck STDMETHOD_(HRESULT, Lock) (THIS_ BOOL bLock) PURE; 286c2c66affSColin Finck }; 287c2c66affSColin Finck #undef INTERFACE 288c2c66affSColin Finck 289c2c66affSColin Finck #if defined(COBJMACROS) 290c2c66affSColin Finck /*** IUnknown methods ***/ 291c2c66affSColin Finck #define ITrayBandSite_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 292c2c66affSColin Finck #define ITrayBandSite_AddRef(p) (p)->lpVtbl->AddRef(p) 293c2c66affSColin Finck #define ITrayBandSite_Release(p) (p)->lpVtbl->Release(p) 294c2c66affSColin Finck /*** IBandSiteStreamCallback methods ***/ 295c2c66affSColin Finck #define ITrayBandSite_OnLoad(p,a,b,c) (p)->lpVtbl->OnLoad(p,a,b,c) 296c2c66affSColin Finck #define ITrayBandSite_OnSave(p,a,b) (p)->lpVtbl->OnSave(p,a,b) 297c2c66affSColin Finck /*** ITrayBandSite methods ***/ 298c2c66affSColin Finck #define ITrayBandSite_IsTaskBand(p,a) (p)->lpVtbl->IsTaskBand(p,a) 299c2c66affSColin Finck #define ITrayBandSite_ProcessMessage(p,a,b,c,d,e) (p)->lpVtbl->ProcessMessage(p,a,b,c,d,e) 300c2c66affSColin Finck #define ITrayBandSite_AddContextMenus(p,a,b,c,d,e,f) (p)->lpVtbl->AddContextMenus(p,a,b,c,d,e,f) 301c2c66affSColin Finck #define ITrayBandSite_Lock(p,a) (p)->lpVtbl->Lock(p,a) 302c2c66affSColin Finck #endif 303c2c66affSColin Finck 304c2c66affSColin Finck HRESULT CTrayBandSite_CreateInstance(IN ITrayWindow *tray, IN IDeskBand* pTaskBand, OUT ITrayBandSite** pBandSite); 305c2c66affSColin Finck 306c2c66affSColin Finck /* 307c2c66affSColin Finck * startmnu.cpp 308c2c66affSColin Finck */ 309c2c66affSColin Finck 310c2c66affSColin Finck HRESULT StartMenuBtnCtxMenuCreator(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu); 311c2c66affSColin Finck 312c2c66affSColin Finck IMenuPopup* 313c2c66affSColin Finck CreateStartMenu(IN ITrayWindow *Tray, 314c2c66affSColin Finck OUT IMenuBand **ppMenuBand, 315c2c66affSColin Finck IN HBITMAP hbmBanner OPTIONAL, 316c2c66affSColin Finck IN BOOL bSmallIcons); 317c2c66affSColin Finck 318c2c66affSColin Finck /* 319c2c66affSColin Finck * startmnucust.cpp 320c2c66affSColin Finck */ 321c2c66affSColin Finck VOID 322c2c66affSColin Finck ShowCustomizeClassic(HINSTANCE, HWND); 323c2c66affSColin Finck 324c2c66affSColin Finck /* 325c2c66affSColin Finck * startmnusite.cpp 326c2c66affSColin Finck */ 327c2c66affSColin Finck 328c2c66affSColin Finck HRESULT 329c2c66affSColin Finck CreateStartMenuSite(IN OUT ITrayWindow *Tray, const IID & riid, PVOID * ppv); 330c2c66affSColin Finck 331c2c66affSColin Finck /* 332c2c66affSColin Finck * trayntfy.c 333c2c66affSColin Finck */ 334c2c66affSColin Finck 335c2c66affSColin Finck /* TrayClockWnd */ 336455bce68SGiannis Adamopoulos HRESULT CTrayClockWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv); 337c2c66affSColin Finck 338c2c66affSColin Finck /* TrayNotifyWnd */ 339c2c66affSColin Finck #define TNWM_GETMINIMUMSIZE (WM_USER + 0x100) 340c2c66affSColin Finck #define TNWM_CHANGETRAYPOS (WM_USER + 0x104) 341c2c66affSColin Finck 342c2c66affSColin Finck #define NTNWM_REALIGN (0x1) 343c2c66affSColin Finck 344455bce68SGiannis Adamopoulos HRESULT CTrayNotifyWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv); 345c2c66affSColin Finck 346455bce68SGiannis Adamopoulos /* SysPagerWnd */ 347455bce68SGiannis Adamopoulos HRESULT CSysPagerWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv); 348c2c66affSColin Finck 349c2c66affSColin Finck /* 350c2c66affSColin Finck * taskswnd.c 351c2c66affSColin Finck */ 352c2c66affSColin Finck 353c2c66affSColin Finck #define TSWM_UPDATETASKBARPOS (WM_USER + 2) 354c2c66affSColin Finck 355455bce68SGiannis Adamopoulos HRESULT CTaskSwitchWnd_CreateInstance(IN HWND hWndParent, IN OUT ITrayWindow *Tray, REFIID riid, void **ppv); 356c2c66affSColin Finck 357c2c66affSColin Finck HRESULT 358c2c66affSColin Finck Tray_OnStartMenuDismissed(ITrayWindow* Tray); 359c2c66affSColin Finck 360c2c66affSColin Finck HRESULT 361c2c66affSColin Finck IsSameObject(IN IUnknown *punk1, IN IUnknown *punk2); 362c2c66affSColin Finck 363c2c66affSColin Finck #endif /* _EXPLORER_PRECOMP__H_ */ 364