[SHELL32] Deduplicate MAX_PROPERTY_SHEET_PAGE and AddPropSheetPageCallback(). #179
[reactos.git] / dll / win32 / shell32 / precomp.h
index f5a950d..03166e3 100644 (file)
@@ -20,7 +20,6 @@
 #include <shlwapi.h>
 #include <shlobj.h>
 #include <shobjidl.h>
-#include <recyclebin.h>
 #include <ndk/rtlfuncs.h>
 #include <fmifs/fmifs.h>
 #include <tchar.h>
@@ -28,6 +27,7 @@
 #include <atlbase.h>
 #include <atlcom.h>
 #include <atlwin.h>
+#include <atlstr.h>
 #include <powrprof.h>
 #include <winnetwk.h>
 #include <objsafe.h>
@@ -41,6 +41,7 @@
 
 #include <shellutils.h>
 
+#include "shellrecyclebin/recyclebin.h"
 #include "wine/pidl.h"
 #include "debughlp.h"
 #include "wine/shell32_main.h"
@@ -53,7 +54,7 @@
 #include "CFolderItemVerbs.h"
 #include "CFolderItems.h"
 #include "CFolder.h"
-#include "CShell.h"
+#include "CShellDispatch.h"
 #include "CDropTargetHelper.h"
 #include "CFolderOptions.h"
 #include "folders/CFSFolder.h"
 #include "folders/CAdminToolsFolder.h"
 #include "folders/CRecycleBin.h"
 #include "droptargets/CexeDropHandler.h"
+#include "droptargets/CFSDropTarget.h"
 #include "COpenWithMenu.h"
 #include "CNewMenu.h"
 #include "dialogs/filedefext.h"
 #include "dialogs/drvdefext.h"
 #include "CQueryAssociations.h"
-#include "shellmenu/CBandSite.h"
 #include "shellmenu/CMenuBand.h"
 #include "shellmenu/CMenuDeskBar.h"
 #include "shellmenu/CMenuSite.h"
@@ -92,4 +93,22 @@ extern const GUID CLSID_UnixDosFolder;
 extern const GUID SHELL32_AdvtShortcutProduct;
 extern const GUID SHELL32_AdvtShortcutComponent;
 
+#define MAX_PROPERTY_SHEET_PAGE 32
+
+extern inline
+BOOL
+CALLBACK
+AddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
+{
+    PROPSHEETHEADERW *pHeader = (PROPSHEETHEADERW *)lParam;
+
+    if (pHeader->nPages < MAX_PROPERTY_SHEET_PAGE)
+    {
+        pHeader->phpage[pHeader->nPages++] = hPage;
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
 #endif /* _PRECOMP_H__ */