Author: gedmurphy
Date: Fri May 2 03:22:09 2008
New Revision: 33232
URL:
http://svn.reactos.org/svn/reactos?rev=33232&view=rev
Log:
- Get the locations of DrawCaptionTemp and RegisterShellHook when required instead of at
link time. This allows building with msvc due to missing .lib stuff
- Remove SHGetViewStatePropertyBag test code
- Move more stuff to appropiate headers
- Remove unneeded linker libs
Modified:
trunk/reactos/base/shell/explorer-new/explorer.rbuild
trunk/reactos/base/shell/explorer-new/precomp.h
trunk/reactos/base/shell/explorer-new/taskswnd.c
trunk/reactos/base/shell/explorer-new/todo.h
trunk/reactos/base/shell/explorer-new/traywnd.c
trunk/reactos/include/psdk/shlobj.h
trunk/reactos/include/psdk/shlwapi.h
trunk/reactos/include/psdk/winuser.h
Modified: trunk/reactos/base/shell/explorer-new/explorer.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/ex…
==============================================================================
--- trunk/reactos/base/shell/explorer-new/explorer.rbuild [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer-new/explorer.rbuild [iso-8859-1] Fri May 2 03:22:09
2008
@@ -11,11 +11,8 @@
<library>gdi32</library>
<library>user32</library>
<library>comctl32</library>
- <library>msvcrt20</library>
- <library>ntdll</library>
<library>ole32</library>
<library>oleaut32</library>
- <library>shdocvw</library>
<library>shell32</library>
<library>shlwapi</library>
<library>uuid</library>
Modified: trunk/reactos/base/shell/explorer-new/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/pr…
==============================================================================
--- trunk/reactos/base/shell/explorer-new/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer-new/precomp.h [iso-8859-1] Fri May 2 03:22:09 2008
@@ -22,6 +22,10 @@
#include "comcsup.h"
#include "todo.h"
#include "undoc.h"
+
+/* dynamic imports due to lack of support in msvc linker libs */
+typedef INT (STDCALL *REGSHELLHOOK)(HWND, DWORD);
+typedef BOOL (STDCALL *DRAWCAPTEMP)(HWND, HDC, const RECT*, HFONT, HICON, LPCWSTR,
UINT);
static ULONG __inline
Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...)
@@ -222,13 +226,6 @@
/*
* desktop.c
*/
-
-#define SHCNRF_InterruptLevel (0x0001)
-#define SHCNRF_ShellLevel (0x0002)
-#define SHCNRF_RecursiveInterrupt (0x1000)
-#define SHCNRF_NewDelivery (0x8000)
-
-
HANDLE
DesktopCreateWindow(IN OUT ITrayWindow *Tray);
Modified: trunk/reactos/base/shell/explorer-new/taskswnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/ta…
==============================================================================
--- trunk/reactos/base/shell/explorer-new/taskswnd.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer-new/taskswnd.c [iso-8859-1] Fri May 2 03:22:09
2008
@@ -1358,6 +1358,7 @@
if (This->hWndToolbar != NULL)
{
+ HMODULE hShell32;
SIZE BtnSize;
/* Identify the version we're using */
@@ -1391,8 +1392,22 @@
/* Register the shell hook */
This->ShellHookMsg = RegisterWindowMessage(TEXT("SHELLHOOK"));
- RegisterShellHook(This->hWnd,
- 3); /* 1 if not NT! We're targeting NT so we don't
care! */
+ hShell32 = LoadLibrary(TEXT("SHELL32.DLL"));
+ if (hShell32 != NULL)
+ {
+ REGSHELLHOOK RegShellHook;
+
+ /* RegisterShellHook */
+ RegShellHook = (REGSHELLHOOK)GetProcAddress(hShell32,
+ (LPCSTR)((LONG)181));
+ if (RegShellHook != NULL)
+ {
+ RegShellHook(This->hWnd,
+ 3); /* 1 if no NT! We're targeting NT so we don't
care! */
+ }
+
+ FreeLibrary(hShell32);
+ }
/* Add all windows to the toolbar */
EnumWindows(TaskSwitchWnd_EnumWindowsProc,
@@ -1414,11 +1429,27 @@
static VOID
TaskSwitchWnd_NCDestroy(IN OUT PTASK_SWITCH_WND This)
{
+ HMODULE hShell32;
+
This->IsDestroying = TRUE;
/* Unregister the shell hook */
- RegisterShellHook(This->hWnd,
- FALSE);
+ hShell32 = LoadLibrary(TEXT("SHELL32.DLL"));
+ if (hShell32 != NULL)
+ {
+ REGSHELLHOOK RegShellHook;
+
+ /* RegisterShellHook */
+ RegShellHook = (REGSHELLHOOK)GetProcAddress(hShell32,
+ (LPCSTR)((LONG)181));
+ if (RegShellHook != NULL)
+ {
+ RegShellHook(This->hWnd,
+ FALSE);
+ }
+
+ FreeLibrary(hShell32);
+ }
TaskSwitchWnd_DeleteAllTasks(This);
}
@@ -1572,6 +1603,7 @@
{
HFONT hCaptionFont, hBoldCaptionFont;
LRESULT Ret = CDRF_DODEFAULT;
+ HMODULE hUser32;
#if TASK_USE_DRAWCAPTIONTEMP != 0
@@ -1627,14 +1659,31 @@
uidctFlags |= DC_ACTIVE;
}
- /* Draw the button content */
- TaskItem->DisplayTooltip = !DrawCaptionTemp(TaskItem->hWnd,
- nmtbcd->nmcd.hdc,
- &nmtbcd->nmcd.rc,
- hCaptionFont,
- NULL,
- NULL,
- uidctFlags);
+ hUser32 = LoadLibrary(TEXT("USER32.DLL"));
+ if (hUser32 != NULL)
+ {
+ DRAWCAPTEMP DrawCapTemp;
+ LONG ord = 187;
+#ifndef UNICODE
+ ord = 186;
+#endif
+ /* DrawCaptionTemp */
+ DrawCapTemp = (DRAWCAPTEMP)GetProcAddress(hUser32,
+ (LPCSTR)ord);
+ if (DrawCapTemp != NULL)
+ {
+ /* Draw the button content */
+ TaskItem->DisplayTooltip = !DrawCapTemp(TaskItem->hWnd,
+ nmtbcd->nmcd.hdc,
+ &nmtbcd->nmcd.rc,
+ hCaptionFont,
+ NULL,
+ NULL,
+ uidctFlags);
+ }
+
+ FreeLibrary(hUser32);
+ }
return CDRF_SKIPDEFAULT;
Modified: trunk/reactos/base/shell/explorer-new/todo.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/to…
==============================================================================
--- trunk/reactos/base/shell/explorer-new/todo.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer-new/todo.h [iso-8859-1] Fri May 2 03:22:09 2008
@@ -1,11 +1,5 @@
#ifndef __TODO_H
#define __TODO_H
-
-/*
- * Stuff missing in our headers
- */
-
-#define SM_REMOTECONTROL 0x2001
/* FIXME: Ugly hack!!! FIX ASAP! Move to uuid! */
static const GUID IID_HACK_IShellView2 =
{0x88E39E80,0x3578,0x11CF,{0xAE,0x69,0x08,0x00,0x2B,0x2E,0x12,0x62}};
@@ -46,18 +40,6 @@
#define IDeskBarClient_GetSize(T,a,b) (T)->lpVtbl->GetSize(T,a,b)
#endif
-
-#define SHGVSPB_PERUSER 0x1
-#define SHGVSPB_PERFOLDER 0x4
-#define SHGVSPB_ROAM 0x00000020
-#define SHGVSPB_NOAUTODEFAULTS 0x80000000
-#define SHGVSPB_FOLDER (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER)
-#define SHGVSPB_FOLDERNODEFAULTS (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER |
SHGVSPB_NOAUTODEFAULTS)
-
-
-#define DBC_SHOW 1
-#define DBC_HIDE 0
-
static const GUID IID_HACK_IShellService =
{0x5836FB00,0x8187,0x11CF,{0xA1,0x2B,0x00,0xAA,0x00,0x4A,0xE8,0x37}};
#define IID_IShellService IID_HACK_IShellService
@@ -80,40 +62,4 @@
#define IShellService_SetOwner(T,a) (T)->lpVtbl->SetOwner(T,a)
#endif
-#if _MSC_VER
-HRESULT WINAPI SHGetViewStatePropertyBag(LPCITEMIDLIST,LPCWSTR,DWORD,REFIID,PVOID*);/*
FIXME: Parameter should be PCIDLIST_ABSOLUTE */
-#else
-typedef HRESULT (WINAPI
*PSHGetViewStatePropertyBag)(LPCITEMIDLIST,LPCWSTR,DWORD,REFIID,PVOID*);
-static HRESULT __inline
-SHGetViewStatePropertyBag(IN LPCITEMIDLIST pidl,
- IN LPCWSTR pszBagName,
- IN DWORD dwFlags,
- IN REFIID riid,
- OUT PVOID* ppv)
-{
- static PSHGetViewStatePropertyBag Func = NULL;
-
- if (Func == NULL)
- {
- HMODULE hShlwapi;
- hShlwapi = LoadLibrary(TEXT("SHLWAPI.DLL"));
- if (hShlwapi != NULL)
- {
- Func = (PSHGetViewStatePropertyBag)GetProcAddress(hShlwapi,
"SHGetViewStatePropertyBag");
- }
- }
-
- if (Func != NULL)
- {
- return Func(pidl, pszBagName, dwFlags, riid, ppv);
- }
-
- MessageBox(NULL, TEXT("SHGetViewStatePropertyBag not available"), NULL,
0);
- return E_NOTIMPL;
-}
-#endif
-
-#define PIDLIST_ABSOLUTE LPITEMIDLIST
-PIDLIST_ABSOLUTE WINAPI SHCloneSpecialIDList(HWND hwnd, int csidl, BOOL fCreate);
-
#endif /* __TODO_H */
Modified: trunk/reactos/base/shell/explorer-new/traywnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/tr…
==============================================================================
--- trunk/reactos/base/shell/explorer-new/traywnd.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer-new/traywnd.c [iso-8859-1] Fri May 2 03:22:09 2008
@@ -1224,6 +1224,7 @@
BOOL Ret;
UINT Flags;
RECT rcButton;
+ HMODULE hUser32;
/* NOTE: This is the backwards compatibility code that is used if the
Common Controls Version 6.0 are not available! */
@@ -1294,13 +1295,30 @@
if (hIconStart != NULL)
Flags |= DC_ICON;
- Ret = DrawCaptionTemp(NULL,
- hDC,
- &rcButton,
- This->hStartBtnFont,
- hIconStart,
- szStartCaption,
- Flags);
+ hUser32 = LoadLibrary(TEXT("USER32.DLL"));
+ if (hUser32 != NULL)
+ {
+ DRAWCAPTEMP DrawCapTemp;
+ LONG ord = 187;
+#ifndef UNICODE
+ ord = 186;
+#endif
+ /* DrawCaptionTemp */
+ DrawCapTemp = (DRAWCAPTEMP)GetProcAddress(hUser32,
+ (LPCSTR)ord);
+ if (DrawCapTemp != NULL)
+ {
+ Ret = DrawCapTemp(NULL,
+ hDC,
+ &rcButton,
+ This->hStartBtnFont,
+ hIconStart,
+ szStartCaption,
+ Flags);
+ }
+
+ FreeLibrary(hUser32);
+ }
SelectObject(hDC,
hbmpOld);
Modified: trunk/reactos/include/psdk/shlobj.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shlobj.h?rev=…
==============================================================================
--- trunk/reactos/include/psdk/shlobj.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/shlobj.h [iso-8859-1] Fri May 2 03:22:09 2008
@@ -441,6 +441,13 @@
STDMETHOD_(HRESULT,GetSize)(THIS_ DWORD,LPRECT) PURE;
};
#undef INTERFACE
+
+#define DBC_GS_IDEAL 0
+#define DBC_GS_SIZEDOWN 1
+
+#define DBC_HIDE 0
+#define DBC_SHOW 1
+#define DBC_SHOWOBSCURE 2
/****************************************************************************
@@ -752,6 +759,7 @@
HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat,
LPVOID pv, int cb);
#define SHGetDataFromIDList WINELIB_NAME_AW(SHGetDataFromIDList)
+PIDLIST_ABSOLUTE WINAPI SHCloneSpecialIDList(HWND hwnd, int csidl, BOOL fCreate);
BOOL WINAPI SHGetSpecialFolderPathA (HWND hwndOwner, LPSTR szPath, int nFolder, BOOL
bCreate);
BOOL WINAPI SHGetSpecialFolderPathW (HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL
bCreate);
#define SHGetSpecialFolderPath WINELIB_NAME_AW(SHGetSpecialFolderPath)
Modified: trunk/reactos/include/psdk/shlwapi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shlwapi.h?rev…
==============================================================================
--- trunk/reactos/include/psdk/shlwapi.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/shlwapi.h [iso-8859-1] Fri May 2 03:22:09 2008
@@ -999,6 +999,24 @@
((ULONGLONG)(mnr)<< 32) | ((ULONGLONG)(bld)<< 16) | (ULONGLONG)(qfe))
HRESULT WINAPI DllInstall(BOOL,LPCWSTR) DECLSPEC_HIDDEN;
+
+
+#if (_WIN32_IE >= 0x0600)
+#define SHGVSPB_PERUSER 0x00000001
+#define SHGVSPB_ALLUSERS 0x00000002
+#define SHGVSPB_PERFOLDER 0x00000004
+#define SHGVSPB_ALLFOLDERS 0x00000008
+#define SHGVSPB_INHERIT 0x00000010
+#define SHGVSPB_ROAM 0x00000020
+#define SHGVSPB_NOAUTODEFAULTS 0x80000000
+
+#define SHGVSPB_FOLDER (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER)
+#define SHGVSPB_FOLDERNODEFAULTS (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER |
SHGVSPB_NOAUTODEFAULTS)
+#define SHGVSPB_USERDEFAULTS (SHGVSPB_PERUSER | SHGVSPB_ALLFOLDERS)
+#define SHGVSPB_GLOBALDEAFAULTS (SHGVSPB_ALLUSERS | SHGVSPB_ALLFOLDERS)
+
+HRESULT WINAPI SHGetViewStatePropertyBag(PCIDLIST_ABSOLUTE pidl, LPCWSTR pszBagName,
DWORD dwFlags, REFIID riid, void** ppv);
+#endif /* (_WIN32_IE >= 0x0600) */
/* IsOS definitions */
Modified: trunk/reactos/include/psdk/winuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winuser.h?rev…
==============================================================================
--- trunk/reactos/include/psdk/winuser.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winuser.h [iso-8859-1] Fri May 2 03:22:09 2008
@@ -1004,6 +1004,7 @@
#define SM_CXFOCUSBORDER 83
#define SM_CYFOCUSBORDER 84
#define SM_SHUTTINGDOWN 0x2000
+#define SM_REMOTECONTROL 0x2001
#endif /* _WIN32_WINNT >= 0x0501 */
#define SM_REMOTESESSION 0X1000
#define ARW_BOTTOMLEFT 0