From c4d7bed97275894816dcca5641ff4d4350ea2497 Mon Sep 17 00:00:00 2001 From: Ged Murphy Date: Fri, 2 May 2008 12:09:39 +0000 Subject: [PATCH] - Remove CLSID_RebarBandSite from uuid, and contain it within explorer as it's an undoc GUID - Load SHInvokeDefaultCommand when required to avoid msvc linker dependencies - explorer_new now builds and links with msvc9, although it'll crash if you try to run it at the moment. Investigation needed. svn path=/trunk/; revision=33234 --- reactos/base/shell/explorer-new/explorer.c | 3 +++ reactos/base/shell/explorer-new/precomp.h | 2 ++ reactos/base/shell/explorer-new/startmnu.c | 26 +++++++++++++++++++--- reactos/base/shell/explorer-new/undoc.h | 3 +-- reactos/lib/sdk/uuid/uuid.c | 1 - 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/reactos/base/shell/explorer-new/explorer.c b/reactos/base/shell/explorer-new/explorer.c index a5544182054..2f7267dc504 100644 --- a/reactos/base/shell/explorer-new/explorer.c +++ b/reactos/base/shell/explorer-new/explorer.c @@ -24,6 +24,9 @@ HINSTANCE hExplorerInstance; HANDLE hProcessHeap; HKEY hkExplorer = NULL; +/* undoc GUID */ +DEFINE_GUID(CLSID_RebarBandSite, 0xECD4FC4D, 0x521C, 0x11D0, 0xB7, 0x92, 0x00, 0xA0, 0xC9, 0x03, 0x12, 0xE1); + LONG SetWindowStyle(IN HWND hWnd, IN LONG dwStyleMask, diff --git a/reactos/base/shell/explorer-new/precomp.h b/reactos/base/shell/explorer-new/precomp.h index acc641ab9fc..eb0d89124d3 100644 --- a/reactos/base/shell/explorer-new/precomp.h +++ b/reactos/base/shell/explorer-new/precomp.h @@ -21,11 +21,13 @@ #include "resource.h" #include "comcsup.h" #include "todo.h" +#include "initguid.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); +typedef HRESULT (STDCALL *SHINVDEFCMD)(HWND, IShellFolder*, LPCITEMIDLIST); static ULONG __inline Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...) diff --git a/reactos/base/shell/explorer-new/startmnu.c b/reactos/base/shell/explorer-new/startmnu.c index c34706f2315..643cf13e83a 100644 --- a/reactos/base/shell/explorer-new/startmnu.c +++ b/reactos/base/shell/explorer-new/startmnu.c @@ -471,12 +471,32 @@ IStartMenuSiteImpl_Execute(IN OUT IStartMenuCallback *iface, IN IShellFolder *pShellFolder, IN LPCITEMIDLIST pidl) { + HMODULE hShlwapi; + HRESULT ret = S_FALSE; + IStartMenuSiteImpl *This = IStartMenuSiteImpl_from_IStartMenuCallback(iface); DbgPrint("IStartMenuCallback::Execute\n"); - return SHInvokeDefaultCommand(ITrayWindow_GetHWND(This->Tray), - pShellFolder, - pidl); + + hShlwapi = LoadLibrary(TEXT("SHLWAPI.DLL")); + if (hShlwapi != NULL) + { + SHINVDEFCMD SHInvokeDefCmd; + + /* SHInvokeDefaultCommand */ + SHInvokeDefCmd = (SHINVDEFCMD)GetProcAddress(hShlwapi, + (LPCSTR)((LONG)279)); + if (SHInvokeDefCmd != NULL) + { + ret = SHInvokeDefCmd(ITrayWindow_GetHWND(This->Tray), + pShellFolder, + pidl); + } + + FreeLibrary(hShlwapi); + } + + return ret; } static HRESULT STDMETHODCALLTYPE diff --git a/reactos/base/shell/explorer-new/undoc.h b/reactos/base/shell/explorer-new/undoc.h index 1a2f6b0da50..a821d4f7982 100644 --- a/reactos/base/shell/explorer-new/undoc.h +++ b/reactos/base/shell/explorer-new/undoc.h @@ -228,8 +228,7 @@ typedef CREATEMRULISTA CREATEMRULIST, *PCREATEMRULIST; #define DrawCaptionTemp DrawCaptionTempA #endif -DEFINE_GUID(CLSID_RebarBandSite, 0xECD4FC4D, 0x521C, 0x11D0, 0xB7, 0x92, 0x00, 0xA0, 0xC9, 0x03, 0x12, 0xE1); -DEFINE_GUID(IID_IDeskBand, 0xEB0FE172, 0x1A3A, 0x11D0, 0x89, 0xB3, 0x00, 0xA0, 0xC9, 0x0A, 0x90, 0xAC); +EXTERN_C const GUID CLSID_RebarBandSite; HRESULT WINAPI SHInvokeDefaultCommand(HWND,IShellFolder*,LPCITEMIDLIST); diff --git a/reactos/lib/sdk/uuid/uuid.c b/reactos/lib/sdk/uuid/uuid.c index 525fac872b3..8ec2f71aa55 100644 --- a/reactos/lib/sdk/uuid/uuid.c +++ b/reactos/lib/sdk/uuid/uuid.c @@ -122,4 +122,3 @@ DEFINE_GUID(CLSID_ComBinding, 0x00000328,0x0000,0x0000,0xc0,0x00,0x0 DEFINE_GUID(CLSID_StdEvent, 0x0000032b,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); DEFINE_GUID(CLSID_ManualResetEvent, 0x0000032c,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); DEFINE_GUID(CLSID_SynchronizeContainer, 0x0000032d,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); -DEFINE_GUID(CLSID_RebarBandSite, 0xECD4FC4D, 0x521C, 0x11D0, 0xB7, 0x92, 0x00, 0xA0, 0xC9, 0x03, 0x12, 0xE1);