xref: /reactos/dll/win32/shell32/precomp.h (revision ac0bcf4a)
1 #ifndef _PRECOMP_H__
2 #define _PRECOMP_H__
3 
4 #include <stdarg.h>
5 #include <assert.h>
6 
7 #define COBJMACROS
8 #define WIN32_NO_STATUS
9 #define _INC_WINDOWS
10 #define COM_NO_WINDOWS_H
11 #define NTOS_MODE_USER
12 
13 #include <windef.h>
14 #include <winbase.h>
15 #include <winreg.h>
16 #include <winuser.h>
17 #include <wincon.h>
18 #include <commdlg.h>
19 #include <ddeml.h>
20 #include <userenv.h>
21 
22 #include <shlwapi.h>
23 #include <wininet.h>
24 #include <shlobj.h>
25 #include <shobjidl.h>
26 #include <ndk/rtlfuncs.h>
27 #include <fmifs/fmifs.h>
28 #include <tchar.h>
29 #include <strsafe.h>
30 #include <atlbase.h>
31 #include <atlcom.h>
32 #include <atlwin.h>
33 #include <atlstr.h>
34 #include <atlsimpcoll.h>
35 #include <atlcoll.h>
36 #include <powrprof.h>
37 #include <winnetwk.h>
38 #include <objsafe.h>
39 
40 #include <comctl32_undoc.h>
41 #include <shlguid_undoc.h>
42 #include <shlobj_undoc.h>
43 #include <shlwapi_undoc.h>
44 
45 #include <shellapi.h>
46 #undef ShellExecute
47 #include <undocshell.h>
48 
49 /*
50  * For versions < Vista+, redefine ShellMessageBoxW to ShellMessageBoxWrapW
51  * (this is needed to avoid a linker error). On Vista+ onwards, shell32.ShellMessageBoxW
52  * redirects to shlwapi.ShellMessageBoxW so the #define should not be needed.
53  *
54  * However our shell32 is built with _WIN32_WINNT set to 0x600 (Vista+),
55  * yet its exports (especially regarding ShellMessageBoxA/W) are Win2003
56  * compatible. So the #define is still needed, and the check be disabled.
57  */
58 // #if (_WIN32_WINNT < 0x0600)
59 #define ShellMessageBoxW ShellMessageBoxWrapW
60 // #endif
61 
62 #include <browseui_undoc.h>
63 
64 #include <shellutils.h>
65 
66 #include "shellrecyclebin/recyclebin.h"
67 #include "wine/pidl.h"
68 #include "debughlp.h"
69 #include "wine/shell32_main.h"
70 #include "shresdef.h"
71 #include "wine/cpanel.h"
72 #include "CActiveDesktop.h"
73 #include "CEnumIDListBase.h"
74 #include "shfldr.h"
75 #include "CShellItem.h"
76 #include "CShellLink.h"
77 #include "CFolderItemVerbs.h"
78 #include "CFolderItems.h"
79 #include "CFolder.h"
80 #include "CShellDispatch.h"
81 #include "CDropTargetHelper.h"
82 #include "CFolderOptions.h"
83 #include "folders/CFSFolder.h"
84 #include "folders/CDrivesFolder.h"
85 #include "folders/CDesktopFolder.h"
86 #include "folders/CControlPanelFolder.h"
87 #include "folders/CMyDocsFolder.h"
88 #include "folders/CNetFolder.h"
89 #include "folders/CFontsFolder.h"
90 #include "folders/CPrinterFolder.h"
91 #include "folders/CAdminToolsFolder.h"
92 #include "folders/CRecycleBin.h"
93 #include "droptargets/CexeDropHandler.h"
94 #include "droptargets/CFSDropTarget.h"
95 #include "COpenWithMenu.h"
96 #include "CNewMenu.h"
97 #include "CSendToMenu.h"
98 #include "CCopyMoveToMenu.h"
99 #include "CCopyAsPathMenu.h"
100 #include "dialogs/filedefext.h"
101 #include "dialogs/drvdefext.h"
102 #include "CQueryAssociations.h"
103 #include "shellmenu/CMenuBand.h"
104 #include "shellmenu/CMenuDeskBar.h"
105 #include "shellmenu/CMenuSite.h"
106 #include "shellmenu/CMergedFolder.h"
107 #include "shellmenu/shellmenu.h"
108 #include "CUserNotification.h"
109 #include "dialogs/folder_options.h"
110 #include "shelldesktop/CChangeNotifyServer.h"
111 
112 #include <wine/debug.h>
113 #include <wine/unicode.h>
114 
115 extern const GUID CLSID_AdminFolderShortcut;
116 extern const GUID CLSID_FontsFolderShortcut;
117 extern const GUID CLSID_StartMenu;
118 extern const GUID CLSID_MenuBandSite;
119 extern const GUID CLSID_OpenWith;
120 extern const GUID CLSID_UnixFolder;
121 extern const GUID CLSID_UnixDosFolder;
122 extern const GUID SHELL32_AdvtShortcutProduct;
123 extern const GUID SHELL32_AdvtShortcutComponent;
124 
125 #define MAX_PROPERTY_SHEET_PAGE 32
126 
127 extern inline
128 BOOL
129 CALLBACK
130 AddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
131 {
132     PROPSHEETHEADERW *pHeader = (PROPSHEETHEADERW *)lParam;
133 
134     if (pHeader->nPages < MAX_PROPERTY_SHEET_PAGE)
135     {
136         pHeader->phpage[pHeader->nPages++] = hPage;
137         return TRUE;
138     }
139 
140     return FALSE;
141 }
142 
143 HRESULT
144 SHELL32_ShowPropertiesDialog(IDataObject *pdtobj);
145 HRESULT
146 SHELL32_DefaultContextMenuCallBack(IShellFolder *psf, IDataObject *pdo, UINT msg);
147 #define SHELL_ExecuteControlPanelCPL(hwnd, cpl) SHRunControlPanel((cpl), (hwnd))
148 
149 // CStubWindow32 --- The owner window of file property sheets.
150 // This window hides taskbar button of property sheet.
151 class CStubWindow32 : public CWindowImpl<CStubWindow32>
152 {
153 public:
154     DECLARE_WND_CLASS_EX(_T("StubWindow32"), 0, COLOR_WINDOWTEXT)
155 
156     BEGIN_MSG_MAP(CStubWindow32)
157     END_MSG_MAP()
158 };
159 
160 HRESULT
161 Shell_TranslateIDListAlias(
162     _In_ LPCITEMIDLIST pidl,
163     _In_ HANDLE hToken,
164     _Out_ LPITEMIDLIST *ppidlAlias,
165     _In_ DWORD dwFlags);
166 
167 BOOL BindCtx_ContainsObject(_In_ IBindCtx *pBindCtx, _In_ LPCWSTR pszName);
168 DWORD BindCtx_GetMode(_In_ IBindCtx *pbc, _In_ DWORD dwDefault);
169 BOOL SHSkipJunctionBinding(_In_ IBindCtx *pbc, _In_ CLSID *pclsid);
170 HRESULT SHIsFileSysBindCtx(_In_ IBindCtx *pBindCtx, _Out_opt_ WIN32_FIND_DATAW *pFindData);
171 BOOL Shell_FailForceReturn(_In_ HRESULT hr);
172 
173 EXTERN_C INT
174 Shell_ParseSpecialFolder(_In_ LPCWSTR pszStart, _Out_ LPWSTR *ppch, _Out_ INT *pcch);
175 
176 HRESULT
177 Shell_DisplayNameOf(
178     _In_ IShellFolder *psf,
179     _In_ LPCITEMIDLIST pidl,
180     _In_ DWORD dwFlags,
181     _Out_ LPWSTR pszBuf,
182     _In_ UINT cchBuf);
183 
184 HRESULT SHBindToObject(
185     _In_opt_ IShellFolder *psf,
186     _In_ LPCITEMIDLIST pidl,
187     _In_ REFIID riid,
188     _Out_ void **ppvObj);
189 
190 HRESULT
191 SHBindToObjectEx(
192     _In_opt_ IShellFolder *pShellFolder,
193     _In_ LPCITEMIDLIST pidl,
194     _In_opt_ IBindCtx *pBindCtx,
195     _In_ REFIID riid,
196     _Out_ void **ppvObj);
197 
198 DWORD
199 SHGetAttributes(_In_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ DWORD dwAttributes);
200 HRESULT SHCoInitializeAnyApartment(VOID);
201 
202 HRESULT
203 SHGetNameAndFlagsW(
204     _In_ LPCITEMIDLIST pidl,
205     _In_ DWORD dwFlags,
206     _Out_opt_ LPWSTR pszText,
207     _In_ UINT cchBuf,
208     _Inout_opt_ DWORD *pdwAttributes);
209 
210 EXTERN_C HWND BindCtx_GetUIWindow(_In_ IBindCtx *pBindCtx);
211 
212 EXTERN_C HRESULT
213 BindCtx_RegisterObjectParam(
214     _In_ IBindCtx *pBindCtx,
215     _In_ LPOLESTR pszKey,
216     _In_opt_ IUnknown *punk,
217     _Out_ LPBC *ppbc);
218 
219 BOOL PathIsDotOrDotDotW(_In_ LPCWSTR pszPath);
220 BOOL PathIsValidElement(_In_ LPCWSTR pszPath);
221 BOOL PathIsDosDevice(_In_ LPCWSTR pszName);
222 HRESULT SHILAppend(_Inout_ LPITEMIDLIST pidl, _Inout_ LPITEMIDLIST *ppidl);
223 
224 #endif /* _PRECOMP_H__ */
225