2014-11-25 16:17:58 +00:00
|
|
|
#ifndef _EXPLORER_PRECOMP__H_
|
|
|
|
#define _EXPLORER_PRECOMP__H_
|
|
|
|
|
2014-12-11 16:33:43 +00:00
|
|
|
#define WIN7_COMPAT_MODE 0
|
2015-07-29 01:29:29 +00:00
|
|
|
#define WIN7_DEBUG_MODE 0
|
|
|
|
|
|
|
|
#if WIN7_DEBUG_MODE && !WIN7_COMPAT_MODE
|
|
|
|
#undef WIN7_COMPAT_MODE
|
|
|
|
#define WIN7_COMPAT_MODE 1
|
|
|
|
#endif
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <tchar.h>
|
|
|
|
|
|
|
|
#define WIN32_NO_STATUS
|
|
|
|
#define _INC_WINDOWS
|
|
|
|
#define COM_NO_WINDOWS_H
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#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>
|
2017-10-30 15:39:12 +00:00
|
|
|
#include <atlstr.h>
|
2018-01-18 14:53:33 +00:00
|
|
|
#include <atlcoll.h>
|
2018-07-13 08:34:42 +00:00
|
|
|
#include <atlsimpcoll.h>
|
2014-11-25 16:17:58 +00:00
|
|
|
#include <shellapi.h>
|
|
|
|
#include <shlobj.h>
|
|
|
|
#include <shlwapi.h>
|
|
|
|
#include <uxtheme.h>
|
2018-01-18 14:53:33 +00:00
|
|
|
#include <process.h>
|
2014-11-25 16:17:58 +00:00
|
|
|
#include <strsafe.h>
|
2014-11-27 20:27:19 +00:00
|
|
|
|
2014-11-25 16:17:58 +00:00
|
|
|
#include <undocuser.h>
|
2014-12-09 21:37:59 +00:00
|
|
|
#include <shlwapi_undoc.h>
|
2014-11-27 20:27:19 +00:00
|
|
|
#include <shlobj_undoc.h>
|
|
|
|
#include <shlguid_undoc.h>
|
2014-11-25 16:17:58 +00:00
|
|
|
#include <undocshell.h>
|
2014-11-27 20:27:19 +00:00
|
|
|
|
2014-11-25 16:17:58 +00:00
|
|
|
#include <rosctrls.h>
|
2017-10-30 15:39:12 +00:00
|
|
|
#include <rosdlgs.h>
|
2014-11-27 20:27:19 +00:00
|
|
|
#include <shellutils.h>
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
#include "tmschema.h"
|
|
|
|
#include "resource.h"
|
|
|
|
|
|
|
|
#include <wine/debug.h>
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(explorernew);
|
|
|
|
|
|
|
|
#define ASSERT(cond) \
|
|
|
|
do if (!(cond)) { \
|
|
|
|
Win32DbgPrint(__FILE__, __LINE__, "ASSERTION %s FAILED!\n", #cond); \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
extern HINSTANCE hExplorerInstance;
|
|
|
|
extern HANDLE hProcessHeap;
|
|
|
|
extern HKEY hkExplorer;
|
2018-06-22 14:34:16 +00:00
|
|
|
extern BOOL bExplorerIsShell;
|
2014-11-25 16:17:58 +00:00
|
|
|
|
2017-05-28 18:31:48 +00:00
|
|
|
#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
|
|
|
|
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
|
|
|
|
|
2014-11-25 16:17:58 +00:00
|
|
|
/*
|
|
|
|
* explorer.c
|
|
|
|
*/
|
|
|
|
|
2014-12-09 22:01:46 +00:00
|
|
|
static inline
|
2014-11-25 16:17:58 +00:00
|
|
|
LONG
|
|
|
|
SetWindowStyle(IN HWND hWnd,
|
2016-06-04 14:09:20 +00:00
|
|
|
IN LONG dwStyleMask,
|
|
|
|
IN LONG dwStyle)
|
2014-12-09 22:01:46 +00:00
|
|
|
{
|
|
|
|
return SHSetWindowBits(hWnd, GWL_STYLE, dwStyleMask, dwStyle);
|
|
|
|
}
|
2014-11-25 16:17:58 +00:00
|
|
|
|
2014-12-09 22:01:46 +00:00
|
|
|
static inline
|
2014-11-25 16:17:58 +00:00
|
|
|
LONG
|
|
|
|
SetWindowExStyle(IN HWND hWnd,
|
2016-06-04 14:09:20 +00:00
|
|
|
IN LONG dwStyleMask,
|
|
|
|
IN LONG dwStyle)
|
2014-12-09 22:01:46 +00:00
|
|
|
{
|
|
|
|
return SHSetWindowBits(hWnd, GWL_EXSTYLE, dwStyleMask, dwStyle);
|
|
|
|
}
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
HMENU
|
|
|
|
LoadPopupMenu(IN HINSTANCE hInstance,
|
2016-06-04 14:09:20 +00:00
|
|
|
IN LPCWSTR lpMenuName);
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
HMENU
|
|
|
|
FindSubMenu(IN HMENU hMenu,
|
2016-06-04 14:09:20 +00:00
|
|
|
IN UINT uItem,
|
|
|
|
IN BOOL fByPosition);
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
BOOL
|
2016-06-04 14:09:20 +00:00
|
|
|
GetCurrentLoggedOnUserName(OUT LPWSTR szBuffer,
|
|
|
|
IN DWORD dwBufferSize);
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
BOOL
|
|
|
|
FormatMenuString(IN HMENU hMenu,
|
2016-06-04 14:09:20 +00:00
|
|
|
IN UINT uPosition,
|
|
|
|
IN UINT uFlags,
|
|
|
|
...);
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
BOOL
|
|
|
|
GetExplorerRegValueSet(IN HKEY hKey,
|
2016-06-04 14:09:20 +00:00
|
|
|
IN LPCWSTR lpSubKey,
|
|
|
|
IN LPCWSTR lpValue);
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* rshell.c
|
|
|
|
*/
|
|
|
|
|
2017-04-16 19:29:27 +00:00
|
|
|
VOID InitRSHELL(VOID);
|
2017-06-19 14:27:51 +00:00
|
|
|
HRESULT WINAPI _CStartMenu_CreateInstance(REFIID riid, void **ppv);
|
2014-11-27 21:11:29 +00:00
|
|
|
HANDLE WINAPI _SHCreateDesktop(IShellDesktopTray *ShellDesk);
|
|
|
|
BOOL WINAPI _SHDesktopMessageLoop(HANDLE hDesktop);
|
|
|
|
DWORD WINAPI _WinList_Init(void);
|
|
|
|
void WINAPI _ShellDDEInit(BOOL bInit);
|
2017-04-16 19:29:27 +00:00
|
|
|
HRESULT WINAPI _CBandSiteMenu_CreateInstance(REFIID riid, void **ppv);
|
|
|
|
HRESULT WINAPI _CBandSite_CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, void **ppv);
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* traywnd.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define TWM_OPENSTARTMENU (WM_USER + 260)
|
2017-10-30 15:39:12 +00:00
|
|
|
#define TWM_SETTINGSCHANGED (WM_USER + 300)
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
extern const GUID IID_IShellDesktopTray;
|
|
|
|
|
|
|
|
#define INTERFACE ITrayWindow
|
|
|
|
DECLARE_INTERFACE_(ITrayWindow, IUnknown)
|
|
|
|
{
|
|
|
|
/*** IUnknown methods ***/
|
|
|
|
STDMETHOD_(HRESULT, QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
|
|
|
|
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
|
|
|
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
|
|
|
/*** ITrayWindow methods ***/
|
|
|
|
STDMETHOD_(HRESULT, Open) (THIS) PURE;
|
|
|
|
STDMETHOD_(HRESULT, Close) (THIS) PURE;
|
|
|
|
STDMETHOD_(HWND, GetHWND) (THIS) PURE;
|
|
|
|
STDMETHOD_(BOOL, IsSpecialHWND) (THIS_ HWND hWnd) PURE;
|
|
|
|
STDMETHOD_(BOOL, IsHorizontal) (THIS) PURE;
|
|
|
|
STDMETHOD_(HWND, DisplayProperties) (THIS) PURE;
|
|
|
|
STDMETHOD_(BOOL, ExecContextMenuCmd) (THIS_ UINT uiCmd) PURE;
|
|
|
|
STDMETHOD_(BOOL, Lock) (THIS_ BOOL bLock) PURE;
|
|
|
|
};
|
|
|
|
#undef INTERFACE
|
|
|
|
|
|
|
|
#if defined(COBJMACROS)
|
|
|
|
/*** IUnknown methods ***/
|
|
|
|
#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)
|
|
|
|
/*** ITrayWindow methods ***/
|
|
|
|
#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)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
RegisterTrayWindowClass(VOID);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
UnregisterTrayWindowClass(VOID);
|
|
|
|
|
|
|
|
HRESULT CreateTrayWindow(ITrayWindow ** ppTray);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
TrayProcessMessages(IN OUT ITrayWindow *Tray);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
TrayMessageLoop(IN OUT ITrayWindow *Tray);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* settings.c
|
|
|
|
*/
|
|
|
|
|
2017-10-30 15:39:12 +00:00
|
|
|
typedef struct _TW_STUCKRECTS2
|
|
|
|
{
|
|
|
|
DWORD cbSize;
|
|
|
|
LONG Unknown;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
DWORD dwFlags;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
DWORD AutoHide : 1;
|
|
|
|
DWORD AlwaysOnTop : 1;
|
|
|
|
DWORD SmallIcons : 1;
|
|
|
|
DWORD HideClock : 1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
DWORD Position;
|
|
|
|
SIZE Size;
|
|
|
|
RECT Rect;
|
|
|
|
} TW_STRUCKRECTS2, *PTW_STUCKRECTS2;
|
|
|
|
|
|
|
|
struct TaskbarSettings
|
2014-11-25 16:17:58 +00:00
|
|
|
{
|
2017-04-14 18:08:34 +00:00
|
|
|
BOOL bLock;
|
|
|
|
BOOL bGroupButtons;
|
2014-11-25 16:17:58 +00:00
|
|
|
BOOL bShowSeconds;
|
2017-04-14 18:08:34 +00:00
|
|
|
BOOL bHideInactiveIcons;
|
2017-10-30 15:39:12 +00:00
|
|
|
TW_STRUCKRECTS2 sr;
|
2017-04-14 18:08:34 +00:00
|
|
|
|
2017-10-30 15:39:12 +00:00
|
|
|
BOOL Load();
|
|
|
|
BOOL Save();
|
|
|
|
};
|
2014-11-25 16:17:58 +00:00
|
|
|
|
2017-10-30 15:39:12 +00:00
|
|
|
extern TaskbarSettings g_TaskbarSettings;
|
2014-11-25 16:17:58 +00:00
|
|
|
|
2014-11-27 21:11:29 +00:00
|
|
|
/*
|
|
|
|
* shellservice.cpp
|
|
|
|
*/
|
|
|
|
HRESULT InitShellServices(HDPA * phdpa);
|
|
|
|
HRESULT ShutdownShellServices(HDPA hdpa);
|
|
|
|
|
2014-11-25 16:17:58 +00:00
|
|
|
/*
|
|
|
|
* startup.cpp
|
|
|
|
*/
|
|
|
|
|
2018-06-22 14:02:25 +00:00
|
|
|
BOOL DoStartStartupItems(ITrayWindow *Tray);
|
|
|
|
INT ProcessStartupItems(VOID);
|
|
|
|
BOOL DoFinishStartupItems(VOID);
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* trayprop.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
VOID
|
2017-10-30 15:39:12 +00:00
|
|
|
DisplayTrayProperties(IN HWND hwndOwner, IN HWND hwndTaskbar);
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* desktop.cpp
|
|
|
|
*/
|
|
|
|
HANDLE
|
|
|
|
DesktopCreateWindow(IN OUT ITrayWindow *Tray);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
DesktopDestroyShellWindow(IN HANDLE hDesktop);
|
|
|
|
|
2016-02-08 23:16:36 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* notifyiconscust.cpp
|
|
|
|
*/
|
|
|
|
VOID
|
|
|
|
ShowCustomizeNotifyIcons(HINSTANCE, HWND);
|
|
|
|
|
2014-11-25 16:17:58 +00:00
|
|
|
/*
|
|
|
|
* taskband.cpp
|
|
|
|
*/
|
|
|
|
|
2017-03-23 15:39:34 +00:00
|
|
|
extern const GUID CLSID_ITaskBand; /* Internal Task Band CLSID */
|
2017-03-26 16:46:55 +00:00
|
|
|
HRESULT CTaskBand_CreateInstance(IN ITrayWindow *Tray, HWND hWndStartButton, REFIID riid, void **ppv);
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* tbsite.cpp
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define INTERFACE ITrayBandSite
|
|
|
|
DECLARE_INTERFACE_(ITrayBandSite, IUnknown)
|
|
|
|
{
|
|
|
|
/*** IUnknown methods ***/
|
|
|
|
STDMETHOD_(HRESULT, QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
|
|
|
|
STDMETHOD_(ULONG, AddRef) (THIS) PURE;
|
|
|
|
STDMETHOD_(ULONG, Release) (THIS) PURE;
|
|
|
|
/*** IBandSiteStreamCallback ***/
|
|
|
|
STDMETHOD_(HRESULT, OnLoad)(THIS_ IStream *pStm, REFIID riid, PVOID *pvObj) PURE;
|
|
|
|
STDMETHOD_(HRESULT, OnSave)(THIS_ IUnknown *pUnk, IStream *pStm) PURE;
|
|
|
|
/*** ITrayBandSite methods ***/
|
|
|
|
STDMETHOD_(HRESULT, IsTaskBand) (THIS_ IUnknown *punk) PURE;
|
|
|
|
STDMETHOD_(HRESULT, ProcessMessage) (THIS_ HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult) PURE;
|
|
|
|
STDMETHOD_(HRESULT, AddContextMenus) (THIS_ HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags, IContextMenu **ppcm) PURE;
|
|
|
|
STDMETHOD_(HRESULT, Lock) (THIS_ BOOL bLock) PURE;
|
|
|
|
};
|
|
|
|
#undef INTERFACE
|
|
|
|
|
|
|
|
#if defined(COBJMACROS)
|
|
|
|
/*** IUnknown methods ***/
|
|
|
|
#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)
|
|
|
|
/*** IBandSiteStreamCallback methods ***/
|
|
|
|
#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)
|
|
|
|
/*** ITrayBandSite methods ***/
|
|
|
|
#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)
|
|
|
|
#endif
|
|
|
|
|
2017-03-23 15:39:34 +00:00
|
|
|
HRESULT CTrayBandSite_CreateInstance(IN ITrayWindow *tray, IN IDeskBand* pTaskBand, OUT ITrayBandSite** pBandSite);
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* startmnu.cpp
|
|
|
|
*/
|
|
|
|
|
|
|
|
HRESULT StartMenuBtnCtxMenuCreator(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu);
|
|
|
|
|
|
|
|
IMenuPopup*
|
|
|
|
CreateStartMenu(IN ITrayWindow *Tray,
|
2016-06-04 14:09:20 +00:00
|
|
|
OUT IMenuBand **ppMenuBand,
|
|
|
|
IN HBITMAP hbmBanner OPTIONAL,
|
|
|
|
IN BOOL bSmallIcons);
|
2014-11-25 16:17:58 +00:00
|
|
|
|
2015-11-22 09:28:45 +00:00
|
|
|
/*
|
|
|
|
* startmnucust.cpp
|
|
|
|
*/
|
|
|
|
VOID
|
|
|
|
ShowCustomizeClassic(HINSTANCE, HWND);
|
|
|
|
|
2014-11-25 16:17:58 +00:00
|
|
|
/*
|
|
|
|
* startmnusite.cpp
|
|
|
|
*/
|
|
|
|
|
|
|
|
HRESULT
|
|
|
|
CreateStartMenuSite(IN OUT ITrayWindow *Tray, const IID & riid, PVOID * ppv);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* trayntfy.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* TrayClockWnd */
|
2018-01-28 12:21:45 +00:00
|
|
|
HRESULT CTrayClockWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv);
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
/* TrayNotifyWnd */
|
|
|
|
#define TNWM_GETMINIMUMSIZE (WM_USER + 0x100)
|
|
|
|
#define TNWM_CHANGETRAYPOS (WM_USER + 0x104)
|
|
|
|
|
|
|
|
#define NTNWM_REALIGN (0x1)
|
|
|
|
|
2018-01-28 12:21:45 +00:00
|
|
|
HRESULT CTrayNotifyWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv);
|
2014-12-17 12:44:58 +00:00
|
|
|
|
2018-01-28 12:21:45 +00:00
|
|
|
/* SysPagerWnd */
|
|
|
|
HRESULT CSysPagerWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv);
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* taskswnd.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define TSWM_UPDATETASKBARPOS (WM_USER + 2)
|
|
|
|
|
2018-01-28 12:21:45 +00:00
|
|
|
HRESULT CTaskSwitchWnd_CreateInstance(IN HWND hWndParent, IN OUT ITrayWindow *Tray, REFIID riid, void **ppv);
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
HRESULT
|
2014-12-17 12:44:58 +00:00
|
|
|
Tray_OnStartMenuDismissed(ITrayWindow* Tray);
|
2014-11-25 16:17:58 +00:00
|
|
|
|
|
|
|
HRESULT
|
|
|
|
IsSameObject(IN IUnknown *punk1, IN IUnknown *punk2);
|
|
|
|
|
|
|
|
#endif /* _EXPLORER_PRECOMP__H_ */
|