[MPLAY32]
authorDavid Quintana <gigaherz@gmail.com>
Wed, 12 Feb 2014 17:48:49 +0000 (17:48 +0000)
committerDavid Quintana <gigaherz@gmail.com>
Wed, 12 Feb 2014 17:48:49 +0000 (17:48 +0000)
* Remove from build while it hangs VS2013.

[EXPLORER-NEW]
* Hack it to work on Windows 7, even if an existing explorer is already running.
* Move start menu popup to its own function, for easier debugging.
* Maybe-fix a drawing issue if no theme is selected.

[RSHELL]
* Added wrapper for CMenuBand
* The cmake script should not use a hardcoded path
* Better name for the log file.
CORE-7886

svn path=/branches/shell-experiments/; revision=62134

base/applications/CMakeLists.txt
base/shell/explorer-new/explorer.c
base/shell/explorer-new/trayntfy.c
base/shell/explorer-new/traywnd.c
base/shell/rshell/CMakeLists.txt
base/shell/rshell/CMenuBand.cpp
base/shell/rshell/CMenuDeskBar.cpp [new file with mode: 0644]
base/shell/rshell/CStartMenu.cpp
base/shell/rshell/precomp.h
base/shell/rshell/wraplog.cpp

index ca7fba2..c379edc 100644 (file)
@@ -16,7 +16,6 @@ add_subdirectory(kbswitch)
 add_subdirectory(logoff)
 add_subdirectory(magnify)
 add_subdirectory(mmc)
-add_subdirectory(mplay32)
 add_subdirectory(msconfig)
 add_subdirectory(mscutils)
 add_subdirectory(mstsc)
index a574a5b..87c7e0d 100644 (file)
@@ -407,7 +407,7 @@ _tWinMain(IN HINSTANCE hInstance,
 
     ProcessStartupItems();
 
-    if (GetShellWindow() == NULL)
+    //if (GetShellWindow() == NULL)
         CreateShellDesktop = TRUE;
 
     /* FIXME - initialize SSO Thread */
@@ -415,7 +415,7 @@ _tWinMain(IN HINSTANCE hInstance,
     if (CreateShellDesktop)
     {
         /* Initialize shell dde support */
-        ShellDDEInit(TRUE);
+        //ShellDDEInit(TRUE);
 
         /* Initialize shell icons */
         FileIconInit(TRUE);
@@ -430,15 +430,15 @@ _tWinMain(IN HINSTANCE hInstance,
                left screen corner, but is also needed in order to receive
                HSHELL_* notification messages (which are required for taskbar
                buttons to work right) */
-            HideMinimizedWindows(TRUE);
+            /*HideMinimizedWindows(TRUE);
 
             if (Tray != NULL)
-                hShellDesktop = DesktopCreateWindow(Tray);
+                hShellDesktop = DesktopCreateWindow(Tray);*/
         }
 
-        /* WinXP: Notify msgina to hide the welcome screen */
-        if (!SetShellReadyEvent(TEXT("msgina: ShellReadyEvent")))
-            SetShellReadyEvent(TEXT("Global\\msgina: ShellReadyEvent"));
+        ///* WinXP: Notify msgina to hide the welcome screen */
+        //if (!SetShellReadyEvent(TEXT("msgina: ShellReadyEvent")))
+        //    SetShellReadyEvent(TEXT("Global\\msgina: ShellReadyEvent"));
     }
     else
     {
index ec6e9ad..262fb20 100644 (file)
@@ -1717,6 +1717,8 @@ TrayNotifyWndProc(IN HWND hwnd,
                 TrayNotifyWnd_UpdateTheme(This);
                 return 0;
             case WM_ERASEBKGND:
+                if (!This->TrayTheme)
+                    goto HandleDefaultMessage;
                 return TrayNotifyWnd_DrawBackground(hwnd,
                                                     uMsg,
                                                     wParam,
index b806c5d..7997fd5 100644 (file)
@@ -2072,6 +2072,42 @@ ITrayWindowImpl_DisplayRunFileDlg(IN ITrayWindowImpl *This)
     CloseHandle(CreateThread(NULL, 0, RunFileDlgThread, This, 0, NULL));
 }
 
+static void PopupStartMenu(IN ITrayWindowImpl *This)
+{
+    if (This->StartMenuPopup != NULL)
+    {
+        POINTL pt;
+        RECTL rcExclude;
+        DWORD dwFlags = 0;
+
+        if (GetWindowRect(This->hwndStart,
+            (RECT*) &rcExclude))
+        {
+            if (ITrayWindowImpl_IsPosHorizontal(This))
+            {
+                pt.x = rcExclude.left;
+                pt.y = rcExclude.top;
+                dwFlags |= MPPF_BOTTOM;
+            }
+            else
+            {
+                if (This->Position == ABE_LEFT)
+                    pt.x = rcExclude.left;
+                else
+                    pt.x = rcExclude.right;
+
+                pt.y = rcExclude.bottom;
+                dwFlags |= MPPF_BOTTOM;
+            }
+
+            IMenuPopup_Popup(This->StartMenuPopup,
+                &pt,
+                &rcExclude,
+                dwFlags);
+        }
+    }
+}
+
 static LRESULT CALLBACK
 TrayWndProc(IN HWND hwnd,
             IN UINT uMsg,
@@ -2566,38 +2602,7 @@ HandleTrayContextMenu:
             case WM_COMMAND:
                 if ((HWND)lParam == This->hwndStart)
                 {
-                    if (This->StartMenuPopup != NULL)
-                    {
-                        POINTL pt;
-                        RECTL rcExclude;
-                        DWORD dwFlags = 0;
-
-                        if (GetWindowRect(This->hwndStart,
-                                          (RECT*)&rcExclude))
-                        {
-                            if (ITrayWindowImpl_IsPosHorizontal(This))
-                            {
-                                pt.x = rcExclude.left;
-                                pt.y = rcExclude.top;
-                                dwFlags |= MPPF_BOTTOM;
-                            }
-                            else
-                            {
-                                if (This->Position == ABE_LEFT)
-                                    pt.x = rcExclude.left;
-                                else
-                                    pt.x = rcExclude.right;
-
-                                pt.y = rcExclude.bottom;
-                                dwFlags |= MPPF_BOTTOM;
-                            }
-
-                            IMenuPopup_Popup(This->StartMenuPopup,
-                                             &pt,
-                                             &rcExclude,
-                                             dwFlags);
-                        }
-                    }
+                    PopupStartMenu(This);
                     break;
                 }
 
index 413aeff..ea82357 100644 (file)
@@ -9,6 +9,7 @@ spec2def(rshell.dll rshell.spec ADD_IMPORTLIB)
 list(APPEND SOURCE
     CDesktopBrowser.cpp
     CMenuBand.cpp
+    CMenuDeskBar.cpp
     CMenuSite.cpp
     CStartMenu.cpp
     misc.cpp
@@ -36,5 +37,5 @@ add_importlibs(rshell
 add_custom_command(TARGET rshell POST_BUILD 
   COMMAND "${CMAKE_COMMAND}" -E copy 
      "$<TARGET_FILE:rshell>"
-     "G:/reactos/vs12/reactos/base/shell/explorer-new/$<CONFIGURATION>/$<TARGET_FILE_NAME:rshell>" 
+     "$<TARGET_FILE_DIR:explorer_new>/$<TARGET_FILE_NAME:rshell>" 
   COMMENT "Copying to output directory")
index 507539b..629def1 100644 (file)
@@ -22,7 +22,7 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(CMenuBand);
 
-#define WRAP_LOG 0
+#define WRAP_LOG 1
 
 extern "C" BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
 
diff --git a/base/shell/rshell/CMenuDeskBar.cpp b/base/shell/rshell/CMenuDeskBar.cpp
new file mode 100644 (file)
index 0000000..a5f53e2
--- /dev/null
@@ -0,0 +1,394 @@
+/*
+* Shell Menu Desk Bar
+*
+* Copyright 2014 David Quintana
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+#include "precomp.h"
+#include "wraplog.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(CMenuDeskBar);
+
+#define WRAP_LOG 1
+
+class CMenuDeskBar :
+    public CComCoClass<CMenuDeskBar>,
+    public CComObjectRootEx<CComMultiThreadModelNoCS>,
+    public IOleCommandTarget,
+    public IServiceProvider,
+    public IInputObjectSite,
+    public IInputObject,
+    public IMenuPopup,
+    public IObjectWithSite,
+    public IBanneredBar,
+    public IInitializeObject
+{
+public:
+    CMenuDeskBar();
+    ~CMenuDeskBar();
+
+private:
+#if WRAP_LOG
+    IUnknown * m_IUnknown;
+    IMenuPopup * m_IMenuPopup;
+    IOleCommandTarget * m_IOleCommandTarget;
+    IServiceProvider * m_IServiceProvider;
+    IDeskBar * m_IDeskBar;
+    IOleWindow * m_IOleWindow;
+    IInputObjectSite * m_IInputObjectSite;
+    IInputObject * m_IInputObject;
+    IObjectWithSite * m_IObjectWithSite;
+    IBanneredBar * m_IBanneredBar;
+    IInitializeObject * m_IInitializeObject;
+#else
+#endif
+
+public:
+    // *** IMenuPopup methods ***
+    virtual HRESULT STDMETHODCALLTYPE Popup(POINTL *ppt, RECTL *prcExclude, MP_POPUPFLAGS dwFlags);
+    virtual HRESULT STDMETHODCALLTYPE OnSelect(DWORD dwSelectType);
+    virtual HRESULT STDMETHODCALLTYPE SetSubMenu(IMenuPopup *pmp, BOOL fSet);
+
+    // *** IOleWindow methods ***
+    virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *phwnd);
+    virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
+
+    // *** IObjectWithSite methods ***
+    virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite);
+    virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, PVOID *ppvSite);
+
+    // *** IBanneredBar methods ***
+    virtual HRESULT STDMETHODCALLTYPE SetIconSize(DWORD iIcon);
+    virtual HRESULT STDMETHODCALLTYPE GetIconSize(DWORD* piIcon);
+    virtual HRESULT STDMETHODCALLTYPE SetBitmap(HBITMAP hBitmap);
+    virtual HRESULT STDMETHODCALLTYPE GetBitmap(HBITMAP* phBitmap);
+
+    // *** IInitializeObject methods ***
+    virtual HRESULT STDMETHODCALLTYPE Initialize(THIS);
+
+    // *** IOleCommandTarget methods ***
+    virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText);
+    virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut);
+
+    // *** IServiceProvider methods ***
+    virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject);
+
+    // *** IInputObjectSite methods ***
+    virtual HRESULT STDMETHODCALLTYPE OnFocusChangeIS(LPUNKNOWN lpUnknown, BOOL bFocus);
+
+    // *** IInputObject methods ***
+    virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL bActivating, LPMSG lpMsg);
+    virtual HRESULT STDMETHODCALLTYPE HasFocusIO(THIS);
+    virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO(LPMSG lpMsg);
+
+    // *** IDeskBar methods ***
+    virtual HRESULT STDMETHODCALLTYPE SetClient(IUnknown *punkClient);
+    virtual HRESULT STDMETHODCALLTYPE GetClient(IUnknown **ppunkClient);
+    virtual HRESULT STDMETHODCALLTYPE OnPosRectChangeDB(LPRECT prc);
+
+
+    DECLARE_NOT_AGGREGATABLE(CMenuDeskBar)
+    DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+    BEGIN_COM_MAP(CMenuDeskBar)
+        COM_INTERFACE_ENTRY_IID(IID_IMenuPopup, IMenuPopup)
+        COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
+        COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
+        COM_INTERFACE_ENTRY_IID(IID_IInputObjectSite, IInputObjectSite)
+        COM_INTERFACE_ENTRY_IID(IID_IInputObject, IInputObject)
+        COM_INTERFACE_ENTRY_IID(IID_IDeskBar, IMenuPopup)
+        COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IMenuPopup)
+        COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite)
+        COM_INTERFACE_ENTRY_IID(IID_IBanneredBar, IBanneredBar)
+        COM_INTERFACE_ENTRY_IID(IID_IInitializeObject, IInitializeObject)
+    END_COM_MAP()
+};
+
+extern "C"
+HRESULT CMenuDeskBar_Constructor(REFIID riid, LPVOID *ppv)
+{
+    *ppv = NULL;
+
+    CMenuDeskBar * deskbar = new CComObject<CMenuDeskBar>();
+
+    if (!deskbar)
+        return E_OUTOFMEMORY;
+
+    HRESULT hr = deskbar->QueryInterface(riid, ppv);
+
+    if (FAILED(hr))
+        deskbar->Release();
+
+    return hr;
+}
+
+CMenuDeskBar::CMenuDeskBar()
+{
+    HRESULT hr;
+    WrapLogOpen();
+
+    hr = CoCreateInstance(CLSID_MenuDeskBar, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IMenuPopup, &m_IMenuPopup));
+    hr = m_IMenuPopup->QueryInterface(IID_PPV_ARG(IUnknown, &m_IUnknown));
+
+    hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IOleCommandTarget, &m_IOleCommandTarget));
+    hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IServiceProvider, &m_IServiceProvider));
+    hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IDeskBar, &m_IDeskBar));
+    hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IOleWindow, &m_IOleWindow));
+    hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IInputObjectSite, &m_IInputObjectSite));
+    hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IInputObject, &m_IInputObject));
+    hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IObjectWithSite, &m_IObjectWithSite));
+    hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IBanneredBar, &m_IBanneredBar));
+    hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IInitializeObject, &m_IInitializeObject));
+}
+
+CMenuDeskBar::~CMenuDeskBar()
+{
+    m_IUnknown->Release();
+    m_IMenuPopup->Release();
+    m_IOleCommandTarget->Release();
+    m_IServiceProvider->Release();
+    m_IDeskBar->Release();
+    m_IOleWindow->Release();
+    m_IInputObjectSite->Release();
+    m_IInputObject->Release();
+    m_IObjectWithSite->Release();
+    m_IBanneredBar->Release();
+    m_IInitializeObject->Release();
+
+    WrapLogClose();
+}
+
+// *** IMenuPopup methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::Popup(POINTL *ppt, RECTL *prcExclude, MP_POPUPFLAGS dwFlags)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::Popup(POINTL *ppt=%p, RECTL *prcExclude=%p, MP_POPUPFLAGS dwFlags=%08x)\n", this, ppt, prcExclude, dwFlags);
+    HRESULT hr = m_IMenuPopup->Popup(ppt, prcExclude, dwFlags);
+    WrapLogExit("CMenuDeskBar::Popup() = %08x\n", hr);
+    return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnSelect(DWORD dwSelectType)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::OnSelect(DWORD dwSelectType=%08x)\n", this, dwSelectType);
+    HRESULT hr = m_IMenuPopup->OnSelect(dwSelectType);
+    WrapLogExit("CMenuDeskBar::OnSelect() = %08x\n", hr);
+    return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetSubMenu(IMenuPopup *pmp, BOOL fSet)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::SetSubMenu(IMenuPopup *pmp=%p, BOOL fSet=%d)\n", this, pmp, fSet);
+    HRESULT hr = m_IMenuPopup->SetSubMenu(pmp, fSet);
+    WrapLogExit("CMenuDeskBar::SetSubMenu() = %08x\n", hr);
+    return hr;
+}
+
+// *** IOleWindow methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetWindow(HWND *phwnd)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::GetWindow(HWND *phwnd=%p)\n", this, phwnd);
+    HRESULT hr = m_IOleWindow->GetWindow(phwnd);
+    if (phwnd) WrapLogMsg("*phwnd=%p\n", *phwnd);
+    WrapLogExit("CMenuDeskBar::GetWindow() = %08x\n", hr);
+    return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::ContextSensitiveHelp(BOOL fEnterMode)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::ContextSensitiveHelp(BOOL fEnterMode=%d)\n", this, fEnterMode);
+    HRESULT hr = m_IOleWindow->ContextSensitiveHelp(fEnterMode);
+    WrapLogExit("CMenuDeskBar::ContextSensitiveHelp() = %08x\n", hr);
+    return hr;
+}
+
+// *** IObjectWithSite methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetSite(IUnknown *pUnkSite)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::SetSite(IUnknown *pUnkSite=%p)\n", this, pUnkSite);
+    HRESULT hr = m_IObjectWithSite->SetSite(pUnkSite);
+    WrapLogExit("CMenuDeskBar::SetSite() = %08x\n", hr);
+    return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetSite(REFIID riid, PVOID *ppvSite)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::GetSite(REFIID riid=%s, PVOID *ppvSite=%p)\n", this, Wrap(riid), ppvSite);
+    HRESULT hr = m_IObjectWithSite->GetSite(riid, ppvSite);
+    if (ppvSite) WrapLogMsg("*ppvSite=%p\n", *ppvSite);
+    WrapLogExit("CMenuDeskBar::GetSite() = %08x\n", hr);
+    return hr;
+}
+
+// *** IBanneredBar methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetIconSize(DWORD iIcon)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::SetIconSize(DWORD iIcon=%d)\n", this, iIcon);
+    HRESULT hr = m_IBanneredBar->SetIconSize(iIcon);
+    WrapLogExit("CMenuDeskBar::SetIconSize() = %08x\n", hr);
+    return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetIconSize(DWORD* piIcon)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::GetIconSize(DWORD* piIcon=%p)\n", this, piIcon);
+    HRESULT hr = m_IBanneredBar->GetIconSize(piIcon);
+    if (piIcon) WrapLogMsg("*piIcon=%d\n", *piIcon);
+    WrapLogExit("CMenuDeskBar::GetIconSize() = %08x\n", hr);
+    return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetBitmap(HBITMAP hBitmap)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::SetBitmap(HBITMAP hBitmap=%p)\n", this, hBitmap);
+    HRESULT hr = m_IBanneredBar->SetBitmap(hBitmap);
+    WrapLogExit("CMenuDeskBar::SetBitmap() = %08x\n", hr);
+    return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetBitmap(HBITMAP* phBitmap)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::GetBitmap(HBITMAP* phBitmap=%p)\n", this, phBitmap);
+    HRESULT hr = m_IBanneredBar->GetBitmap(phBitmap);
+    if (phBitmap) WrapLogMsg("*phBitmap=%p\n", *phBitmap);
+    WrapLogExit("CMenuDeskBar::GetBitmap() = %08x\n", hr);
+    return hr;
+}
+
+
+// *** IInitializeObject methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::Initialize(THIS)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::Initialize()\n", this);
+    HRESULT hr = m_IInitializeObject->Initialize();
+    WrapLogExit("CMenuDeskBar::Initialize() = %08x\n", hr);
+    return hr;
+}
+
+// *** IOleCommandTarget methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::QueryStatus(const GUID *pguidCmdGroup=%p, ULONG cCmds=%u, prgCmds=%p, pCmdText=%p)\n", this, pguidCmdGroup, cCmds, prgCmds, pCmdText);
+    HRESULT hr = m_IOleCommandTarget->QueryStatus(pguidCmdGroup, cCmds, prgCmds, pCmdText);
+    if (pguidCmdGroup) WrapLogMsg("*pguidCmdGroup=%s\n", Wrap(*pguidCmdGroup));
+    WrapLogExit("CMenuDeskBar::QueryStatus() = %08x\n", hr);
+    return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
+{
+    //bool b;
+
+    WrapLogEnter("CMenuDeskBar<%p>::Exec(const GUID *pguidCmdGroup=%p, DWORD nCmdID=%d, DWORD nCmdexecopt=%d, VARIANT *pvaIn=%p, VARIANT *pvaOut=%p)\n", this, pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
+
+    //if (pguidCmdGroup && IsEqualGUID(*pguidCmdGroup, CLSID_MenuBand))
+    //{
+    //    if (nCmdID == 19) // popup
+    //    {
+    //        b = true;
+    //    }
+    //}
+
+
+    if (pguidCmdGroup) WrapLogMsg("*pguidCmdGroup=%s\n", Wrap(*pguidCmdGroup));
+    HRESULT hr = m_IOleCommandTarget->Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
+    WrapLogExit("CMenuDeskBar::Exec() = %08x\n", hr);
+    return hr;
+}
+
+// *** IServiceProvider methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::QueryService(REFGUID guidService, REFIID riid, void **ppvObject)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::QueryService(REFGUID guidService=%s, REFIID riid=%s, void **ppvObject=%p)\n", this, Wrap(guidService), Wrap(riid), ppvObject);
+
+    //if (IsEqualIID(guidService, SID_SMenuBandChild))
+    //{
+    //    WrapLogMsg("SID is SID_SMenuBandChild. Using QueryInterface of self instead of wrapped object.\n");
+    //    HRESULT hr = this->QueryInterface(riid, ppvObject);
+    //    if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
+    //    WrapLogExit("CMenuDeskBar::QueryService() = %08x\n", hr);
+    //    return hr;
+    //}
+    //else
+    {
+        WrapLogMsg("SID not identified.\n");
+    }
+    HRESULT hr = m_IServiceProvider->QueryService(guidService, riid, ppvObject);
+    if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
+    WrapLogExit("CMenuDeskBar::QueryService() = %08x\n", hr);
+    return hr;
+}
+
+// *** IInputObjectSite methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnFocusChangeIS(LPUNKNOWN lpUnknown, BOOL bFocus)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::OnFocusChangeIS(LPUNKNOWN lpUnknown=%p, BOOL bFocus=%d)\n", this, lpUnknown, bFocus);
+    HRESULT hr = m_IInputObjectSite->OnFocusChangeIS(lpUnknown, bFocus);
+    WrapLogExit("CMenuDeskBar::OnFocusChangeIS() = %08x\n", hr);
+    return hr;
+}
+
+// *** IInputObject methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::UIActivateIO(BOOL bActivating, LPMSG lpMsg)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::UIActivateIO(BOOL bActivating=%d, LPMSG lpMsg=%p)\n", this, bActivating, lpMsg);
+    HRESULT hr = m_IInputObject->UIActivateIO(bActivating, lpMsg);
+    WrapLogExit("CMenuDeskBar::UIActivateIO() = %08x\n", hr);
+    return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::HasFocusIO(THIS)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::HasFocusIO()\n", this);
+    HRESULT hr = m_IInputObject->HasFocusIO();
+    WrapLogExit("CMenuDeskBar::HasFocusIO() = %08x\n", hr);
+    return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::TranslateAcceleratorIO(LPMSG lpMsg)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::TranslateAcceleratorIO(LPMSG lpMsg=%p)\n", this, lpMsg);
+    if (lpMsg) WrapLogMsg("*lpMsg=%s\n", Wrap(*lpMsg));
+    HRESULT hr = m_IInputObject->TranslateAcceleratorIO(lpMsg);
+    WrapLogExit("CMenuDeskBar::TranslateAcceleratorIO() = %08x\n", hr);
+    return hr;
+}
+
+// *** IDeskBar methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetClient(IUnknown *punkClient)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::SetClient(IUnknown *punkClient=%p)\n", this, punkClient);
+    HRESULT hr = m_IDeskBar->SetClient(punkClient);
+    WrapLogExit("CMenuDeskBar::SetClient() = %08x\n", hr);
+    return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetClient(IUnknown **ppunkClient)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::GetClient(IUnknown **ppunkClient=%p)\n", this, ppunkClient);
+    HRESULT hr = m_IDeskBar->GetClient(ppunkClient);
+    if (ppunkClient) WrapLogMsg("*ppunkClient=%p\n", *ppunkClient);
+    WrapLogExit("CMenuDeskBar::GetClient() = %08x\n", hr);
+    return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnPosRectChangeDB(LPRECT prc)
+{
+    WrapLogEnter("CMenuDeskBar<%p>::OnPosRectChangeDB(RECT *prc=%p)\n", this, prc);
+    HRESULT hr = m_IDeskBar->OnPosRectChangeDB(prc);
+    if (prc) WrapLogMsg("*prc=%s\n", Wrap(*prc));
+    WrapLogExit("CMenuDeskBar::OnPosRectChangeDB() = %08x\n", hr);
+    return hr;
+}
index c50fa33..289f476 100644 (file)
@@ -270,7 +270,7 @@ CStartMenu_Constructor(
     if (FAILED(hr))
         return NULL;
 
-#if 1
+#if 0
     hr = CoCreateInstance(CLSID_MenuBandSite,
                           NULL,
                           CLSCTX_INPROC_SERVER,
@@ -281,10 +281,14 @@ CStartMenu_Constructor(
     if (FAILED(hr))
         return NULL;
 
+#if 0
     hr = CoCreateInstance(CLSID_MenuDeskBar,
                           NULL,
                           CLSCTX_INPROC_SERVER,
                           IID_PPV_ARG(IDeskBar, &pDeskBar));
+#else
+    hr = CMenuDeskBar_Constructor(IID_PPV_ARG(IDeskBar, &pDeskBar));
+#endif
     if (FAILED(hr))
         return NULL;
     
index 4b90647..6f5832a 100644 (file)
@@ -30,5 +30,6 @@
 #define SMC_EXEC 4
 extern "C" INT WINAPI Shell_GetCachedImageIndex(LPCWSTR szPath, INT nIndex, UINT bSimulateDoc);
 
+extern "C" HRESULT CMenuDeskBar_Constructor(REFIID riid, LPVOID *ppv);
 extern "C" HRESULT CMenuSite_Constructor(REFIID riid, LPVOID *ppv);
 extern "C" HRESULT CMenuBand_Constructor(REFIID riid, LPVOID *ppv);
\ No newline at end of file
index 9366ed0..b3a131e 100644 (file)
@@ -13,7 +13,7 @@ void WrapLogOpen()
 {
     if (openCount == 0)
     {
-        log = fopen("G:\\CMenuBand.log", "w");
+        log = fopen("G:\\RShellWrap.log", "w");
         nTemps = 0;
         callLevel = 0;
     }