Author: dquintana
Date: Fri Dec  5 16:41:18 2014
New Revision: 65566

URL: http://svn.reactos.org/svn/reactos?rev=65566&view=rev
Log:
[BROWSEUI]
* Make the CBandSiteMenu class actually insert the Toolbars menu, even if it's 
not yet implemented. This fills the top of the taskbar context menu instead of 
leaving an ugly separator at the top.

Modified:
    trunk/reactos/dll/win32/browseui/bandsitemenu.cpp
    trunk/reactos/dll/win32/browseui/bandsitemenu.h
    trunk/reactos/dll/win32/browseui/lang/en-US.rc
    trunk/reactos/dll/win32/browseui/resource.h

Modified: trunk/reactos/dll/win32/browseui/bandsitemenu.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/bandsitemenu.cpp?rev=65566&r1=65565&r2=65566&view=diff
==============================================================================
--- trunk/reactos/dll/win32/browseui/bandsitemenu.cpp   [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/bandsitemenu.cpp   [iso-8859-1] Fri Dec  5 
16:41:18 2014
@@ -31,38 +31,66 @@
 
 HRESULT STDMETHODCALLTYPE CBandSiteMenu::SetOwner(IUnknown *pOwner)
 {
-    FIXME("(%p, %p)\n", this, pOwner);
-    return E_NOTIMPL;
+    TRACE("CBandSiteMenu::SetOwner(%p, %p)\n", this, pOwner);
+    m_Owner = pOwner;
+    return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE CBandSiteMenu::QueryContextMenu(
     HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
 {
-    FIXME("(%p, %p, %u, %u, %u, 0x%x)\n", this, hmenu, indexMenu, idCmdFirst, 
idCmdLast, uFlags);
+    BOOL ret;
+
+    TRACE("CBandSiteMenu::QueryContextMenu(%p, %p, %u, %u, %u, 0x%x)\n", this, 
hmenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
+
+    HMENU hm = LoadMenuW(_AtlBaseModule.GetResourceInstance(), 
MAKEINTRESOURCEW(IDM_TASKBAR_TOOLBARS));
+    if (!hm)
+        return HRESULT_FROM_WIN32(GetLastError());
+
+    MENUITEMINFOW mii = { 0 };
+    mii.cbSize = sizeof(mii);
+    mii.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STATE | MIIM_STRING | MIIM_SUBMENU;
+    ret = GetMenuItemInfoW(hm, 0, TRUE, &mii);
+    if (!hm)
+        return HRESULT_FROM_WIN32(GetLastError());
+
+    mii.dwTypeData = new WCHAR[mii.cch + 1];
+    mii.cch = mii.cch + 1;
+
+    ret = GetMenuItemInfoW(hm, 0, TRUE, &mii);
+    if (!hm)
+        return HRESULT_FROM_WIN32(GetLastError());
+
+    ret = InsertMenuItemW(hmenu, 0, TRUE, &mii);
+
+    delete mii.dwTypeData;
+
+    RemoveMenu(hm, 0, MF_BYPOSITION);
+
     return E_NOTIMPL;
 }
 
 HRESULT STDMETHODCALLTYPE CBandSiteMenu::InvokeCommand(LPCMINVOKECOMMANDINFO 
lpici)
 {
-    FIXME("(%p, %p)\n", this, lpici);
-    return E_NOTIMPL;
+    FIXME("CBandSiteMenu::InvokeCommand is UNIMPLEMENTED (%p, %p)\n", this, 
lpici);
+    return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE CBandSiteMenu::GetCommandString(UINT_PTR idCmd, UINT 
uType,
     UINT *pwReserved, LPSTR pszName, UINT cchMax)
 {
-    FIXME("(%p, %p, %u, %p, %p, %u)\n", this, idCmd, uType, pwReserved, 
pszName, cchMax);
+    FIXME("CBandSiteMenu::GetCommandString is UNIMPLEMENTED (%p, %p, %u, %p, 
%p, %u)\n", this, idCmd, uType, pwReserved, pszName, cchMax);
     return E_NOTIMPL;
 }
 
 HRESULT STDMETHODCALLTYPE CBandSiteMenu::HandleMenuMsg(UINT uMsg, WPARAM 
wParam, LPARAM lParam)
 {
-    FIXME("(%p, %u, %p, %p)\n", this, uMsg, wParam, lParam);
+    FIXME("CBandSiteMenu::HandleMenuMsg is UNIMPLEMENTED (%p, %u, %p, %p)\n", 
this, uMsg, wParam, lParam);
     return E_NOTIMPL;
 }
 
 HRESULT STDMETHODCALLTYPE CBandSiteMenu::HandleMenuMsg2(UINT uMsg, WPARAM 
wParam, LPARAM lParam, LRESULT *plResult)
 {
-    FIXME("(%p, %u, %p, %p, %p)\n", this, uMsg, wParam, lParam, plResult);
+    FIXME("CBandSiteMenu::HandleMenuMsg2 is UNIMPLEMENTED(%p, %u, %p, %p, 
%p)\n", this, uMsg, wParam, lParam, plResult);
     return E_NOTIMPL;
 }

Modified: trunk/reactos/dll/win32/browseui/bandsitemenu.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/bandsitemenu.h?rev=65566&r1=65565&r2=65566&view=diff
==============================================================================
--- trunk/reactos/dll/win32/browseui/bandsitemenu.h     [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/bandsitemenu.h     [iso-8859-1] Fri Dec  5 
16:41:18 2014
@@ -28,6 +28,7 @@
     public IContextMenu3,
     public IShellService
 {
+    CComPtr<IUnknown> m_Owner;
 public:
     CBandSiteMenu();
     ~CBandSiteMenu();

Modified: trunk/reactos/dll/win32/browseui/lang/en-US.rc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/en-US.rc?rev=65566&r1=65565&r2=65566&view=diff
==============================================================================
--- trunk/reactos/dll/win32/browseui/lang/en-US.rc      [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/lang/en-US.rc      [iso-8859-1] Fri Dec  5 
16:41:18 2014
@@ -95,6 +95,17 @@
     END
 END
 
+IDM_TASKBAR_TOOLBARS MENUEX
+BEGIN
+       POPUP "&Toolbars", -1, MFT_STRING, MFS_ENABLED, 0
+       BEGIN
+               MENUITEM "&Desktop", IDM_TASKBAR_TOOLBARS_DESKTOP, MFT_STRING, 
MFS_GRAYED
+               MENUITEM "&Quick Launch", IDM_TASKBAR_TOOLBARS_QUICKLAUNCH, 
MFT_STRING, MFS_GRAYED
+               MENUITEM "", -1, MFT_SEPARATOR, MFS_ENABLED
+               MENUITEM "&New Toolbar...", IDM_TASKBAR_TOOLBARS_NEW, 
MFT_STRING, MFS_GRAYED
+       END
+END
+
 /* Dialogs */
 
 IDD_CUSTOMIZETOOLBAREX DIALOGEX 0, 0, 357, 33

Modified: trunk/reactos/dll/win32/browseui/resource.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/resource.h?rev=65566&r1=65565&r2=65566&view=diff
==============================================================================
--- trunk/reactos/dll/win32/browseui/resource.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/resource.h [iso-8859-1] Fri Dec  5 
16:41:18 2014
@@ -57,6 +57,11 @@
 #define IDM_HELP_ISTHISCOPYLEGAL         0xA104
 #define IDM_HELP_ABOUT                   0xA102
 
+#define IDM_TASKBAR_TOOLBARS                268
+#define IDM_TASKBAR_TOOLBARS_DESKTOP          3
+#define IDM_TASKBAR_TOOLBARS_QUICKLAUNCH      4
+#define IDM_TASKBAR_TOOLBARS_NEW              1
+
 #define IDM_GOTO_TRAVEL_FIRST       0xA141
 #define IDM_GOTO_TRAVEL_LAST        0xA151
 #define IDM_GOTO_TRAVEL_SEP         IDM_GOTO_TRAVEL_FIRST


Reply via email to