ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
February 2014
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
17 participants
464 discussions
Start a n
N
ew thread
[dquintana] 62232: [RSHELL] * CMenuBand: Begin implementing submenus for shell items. * CMenuBand: Begin implementing context menus. CORE-7881
by dquintana@svn.reactos.org
Author: dquintana Date: Mon Feb 17 18:38:31 2014 New Revision: 62232 URL:
http://svn.reactos.org/svn/reactos?rev=62232&view=rev
Log: [RSHELL] * CMenuBand: Begin implementing submenus for shell items. * CMenuBand: Begin implementing context menus. CORE-7881 Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp branches/shell-experiments/base/shell/rshell/CStartMenu.cpp Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Mon Feb 17 18:38:31 2014 @@ -51,10 +51,11 @@ virtual HRESULT PopupItem(UINT uItem) = 0; virtual HRESULT HasSubMenu(UINT uItem) = 0; virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult) = 0; + virtual HRESULT OnContextMenu(NMMOUSE * rclick) = 0; HRESULT OnHotItemChange(const NMTBHOTITEM * hot); - HRESULT PopupSubMenu(UINT uItem, IShellMenu* childShellMenu); + HRESULT PopupSubMenu(UINT index, IShellMenu* childShellMenu); static LRESULT CALLBACK s_SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); protected: @@ -83,6 +84,8 @@ virtual HRESULT PopupItem(UINT uItem); virtual HRESULT HasSubMenu(UINT uItem); virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult); + virtual HRESULT OnContextMenu(NMMOUSE * rclick); + private: HMENU m_hmenu; }; @@ -100,9 +103,10 @@ virtual HRESULT PopupItem(UINT uItem); virtual HRESULT HasSubMenu(UINT uItem); virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult); - + virtual HRESULT OnContextMenu(NMMOUSE * rclick); private: + LPITEMIDLIST GetPidlFromId(UINT uItem, INT* pIndex); IShellFolder * m_shellFolder; LPCITEMIDLIST m_idList; @@ -248,6 +252,7 @@ virtual HRESULT STDMETHODCALLTYPE IsEmpty(THIS); HRESULT CallCBWithId(UINT Id, UINT uMsg, WPARAM wParam, LPARAM lParam); + HRESULT CallCBWithPidl(LPITEMIDLIST pidl, UINT uMsg, WPARAM wParam, LPARAM lParam); BOOL UseBigIcons() { return m_useBigIcons; @@ -957,15 +962,14 @@ return S_OK; } -HRESULT CMenuToolbarBase::PopupSubMenu(UINT uItem, IShellMenu* childShellMenu) -{ +HRESULT CMenuToolbarBase::PopupSubMenu(UINT index, IShellMenu* childShellMenu) +{ + IBandSite* pBandSite; + IDeskBar* pDeskBar; + + HRESULT hr; + RECT rc; - TBBUTTONINFO info = { 0 }; - info.cbSize = sizeof(TBBUTTONINFO); - info.dwMask = 0; - int index = SendMessage(m_hwnd, TB_GETBUTTONINFO, uItem, (LPARAM) &info); - if (index < 0) - return E_FAIL; if (!SendMessage(m_hwnd, TB_GETITEMRECT, index, (LPARAM) &rc)) return E_FAIL; @@ -978,10 +982,6 @@ POINTL pt = { b.x, b.y }; RECTL rcl = { a.x, a.y, b.x, b.y }; // maybe-TODO: fetch client area of deskbar? - IBandSite* pBandSite; - IDeskBar* pDeskBar; - - HRESULT hr; #ifndef USE_BUILTIN_MENUSITE hr = CoCreateInstance(CLSID_MenuBandSite, @@ -1119,6 +1119,56 @@ return S_OK; } +HRESULT CMenuStaticToolbar::OnContextMenu(NMMOUSE * rclick) +{ + CComPtr<IContextMenu> contextMenu; + HRESULT hr = m_menuBand->CallCBWithId(rclick->dwItemSpec, SMC_GETOBJECT, (WPARAM) &IID_IContextMenu, (LPARAM) &contextMenu); + if (hr != S_OK) + return hr; + + HMENU hPopup = CreatePopupMenu(); + + if (hPopup == NULL) + return E_FAIL; + + int ID_SHELL_CMD_FIRST = 0xF; + int ID_SHELL_CMD_LAST = 0x7fef; + hr = contextMenu->QueryContextMenu(hPopup, 0, ID_SHELL_CMD_FIRST, ID_SHELL_CMD_LAST, CMF_VERBSONLY); + if (FAILED(hr)) + { + DestroyMenu(hPopup); + return hr; + } + + POINT pt = rclick->pt; + if (!ClientToScreen(m_hwnd, &pt)) + { + DestroyMenu(hPopup); + return HRESULT_FROM_WIN32(GetLastError()); + } + + CComPtr<IOleWindow> site; + hr = m_menuBand->GetSite(IID_PPV_ARG(IOleWindow, &site)); + if (FAILED(hr)) + { + DestroyMenu(hPopup); + return hr; + } + + HWND hwndSite; + hr = site->GetWindow(&hwndSite); + if (FAILED(hr)) + { + DestroyMenu(hPopup); + return hr; + } + + ::TrackPopupMenu(hPopup, 0, pt.x, pt.y, 0, hwndSite, NULL); + + DestroyMenu(hPopup); + return S_OK; +} + HRESULT CMenuStaticToolbar::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult) { return m_menuBand->CallCBWithId(wParam, SMC_EXEC, 0, 0); @@ -1131,7 +1181,14 @@ if (FAILED(hr)) return hr; - return PopupSubMenu(uItem, shellMenu); + TBBUTTONINFO info = { 0 }; + info.cbSize = sizeof(TBBUTTONINFO); + info.dwMask = 0; + int index = SendMessage(m_hwnd, TB_GETBUTTONINFO, uItem, (LPARAM) &info); + if (index < 0) + return E_FAIL; + + return PopupSubMenu(index, shellMenu); } HRESULT CMenuStaticToolbar::HasSubMenu(UINT uItem) @@ -1175,7 +1232,7 @@ INT index = 0; INT indexOpen = 0; - IShellItem *psi; + CComPtr<IShellItem> psi; SHCreateShellItem(NULL, m_shellFolder, item, &psi); hr = psi->GetDisplayName(SIGDN_NORMALDISPLAY, &MenuString); @@ -1184,9 +1241,18 @@ index = SHMapPIDLToSystemImageListIndex(m_shellFolder, item, &indexOpen); + SFGAOF attrs; + hr = psi->GetAttributes(SFGAO_FOLDER, &attrs); + + if (attrs != 0) + { + tbb.fsStyle |= BTNS_WHOLEDROPDOWN; + } + tbb.idCommand = i++; tbb.iString = (INT_PTR) MenuString; tbb.iBitmap = index; + tbb.dwData = (DWORD_PTR) ILClone(item); SendMessageW(m_hwnd, TB_ADDBUTTONS, 1, (LPARAM) (LPTBBUTTON) &tbb); HeapFree(GetProcessHeap(), 0, MenuString); @@ -1236,20 +1302,104 @@ return hr; } + +LPITEMIDLIST CMenuSFToolbar::GetPidlFromId(UINT uItem, INT* pIndex) +{ + TBBUTTONINFO info = { 0 }; + info.cbSize = sizeof(TBBUTTONINFO); + info.dwMask = 0; + int index = SendMessage(m_hwnd, TB_GETBUTTONINFO, uItem, (LPARAM) &info); + if (index < 0) + return NULL; + + if (pIndex) + *pIndex = index; + + TBBUTTON btn = { 0 }; + if (!SendMessage(m_hwnd, TB_GETBUTTON, index, (LPARAM) &btn)) + return NULL; + + return (LPITEMIDLIST)btn.dwData; +} + +HRESULT CMenuSFToolbar::OnContextMenu(NMMOUSE * rclick) +{ + HRESULT hr; + CComPtr<IOleWindow> site; + CComPtr<IContextMenu> contextMenu; + + hr = m_menuBand->GetSite(IID_PPV_ARG(IOleWindow, &site)); + if (FAILED(hr)) + { + return hr; + } + + HWND hwndSite; + hr = site->GetWindow(&hwndSite); + if (FAILED(hr)) + { + return hr; + } + + LPITEMIDLIST pidl = GetPidlFromId(rclick->dwItemData, NULL); + + hr = m_shellFolder->GetUIObjectOf(hwndSite, 1, (LPCITEMIDLIST *) &pidl, IID_IContextMenu, NULL, (PVOID *) &contextMenu); + if (hr != S_OK) + return hr; + + HMENU hPopup = CreatePopupMenu(); + + if (hPopup == NULL) + return E_FAIL; + + int ID_SHELL_CMD_FIRST = 0xF; + int ID_SHELL_CMD_LAST = 0x7fef; + hr = contextMenu->QueryContextMenu(hPopup, 0, ID_SHELL_CMD_FIRST, ID_SHELL_CMD_LAST, CMF_VERBSONLY); + if (FAILED(hr)) + { + DestroyMenu(hPopup); + return hr; + } + + POINT pt = rclick->pt; + if (!ClientToScreen(m_hwnd, &pt)) + { + DestroyMenu(hPopup); + return HRESULT_FROM_WIN32(GetLastError()); + } + + ::TrackPopupMenu(hPopup, 0, pt.x, pt.y, 0, hwndSite, NULL); + + DestroyMenu(hPopup); + return S_OK; +} + HRESULT CMenuSFToolbar::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult) { - // TODO: return m_menuBand->CallCBWithPidl(GetPidlFromId(wParam), SMC_SFEXEC, 0, 0); - return S_OK; + return m_menuBand->CallCBWithPidl(GetPidlFromId(wParam, NULL), SMC_SFEXEC, 0, 0); } HRESULT CMenuSFToolbar::PopupItem(UINT uItem) { - return S_OK; + int index; + CComPtr<IShellMenu> shellMenu; + HRESULT hr = m_menuBand->CallCBWithPidl(GetPidlFromId(uItem, &index), SMC_GETOBJECT, (WPARAM) &IID_IShellMenu, (LPARAM) &shellMenu); + if (FAILED(hr)) + return hr; + + return PopupSubMenu(index, shellMenu); } HRESULT CMenuSFToolbar::HasSubMenu(UINT uItem) { - return S_FALSE; // GetSubMenu(m_hmenu, uItem) ? S_OK : S_FALSE; + HRESULT hr; + CComPtr<IShellItem> psi; + SHCreateShellItem(NULL, m_shellFolder, GetPidlFromId(uItem, NULL), &psi); + + SFGAOF attrs; + hr = psi->GetAttributes(SFGAO_FOLDER, &attrs); + + return (attrs != 0) ? S_OK : S_FALSE; } CMenuBand::CMenuBand() : @@ -1811,6 +1961,7 @@ NMHDR * hdr = (LPNMHDR) lParam; NMTBCUSTOMDRAW * cdraw; NMTBHOTITEM * hot; + NMMOUSE * rclick; switch (hdr->code) { case TBN_HOTITEMCHANGE: @@ -1828,6 +1979,20 @@ return S_OK; + case NM_RCLICK: + rclick = (LPNMMOUSE) hdr; + + if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd)) + { + return m_staticToolbar->OnContextMenu(rclick); + } + + if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd)) + { + return m_SFToolbar->OnContextMenu(rclick); + } + + return S_OK; case NM_CUSTOMDRAW: cdraw = (LPNMTBCUSTOMDRAW) hdr; switch (cdraw->nmcd.dwDrawStage) @@ -1984,7 +2149,7 @@ return hr; } -HRESULT CMenuBand::_CallCB(UINT uMsg, WPARAM wParam, LPARAM lParam) +HRESULT CMenuBand::CallCBWithPidl(LPITEMIDLIST pidl, UINT uMsg, WPARAM wParam, LPARAM lParam) { if (!m_psmc) return S_FALSE; @@ -1997,6 +2162,7 @@ smData.uIdParent = m_uId; smData.uIdAncestor = m_uIdAncestor; smData.hwnd = hwnd; + smData.pidlItem = pidl; if (m_staticToolbar) { smData.hmenu = m_hmenu; @@ -2010,4 +2176,31 @@ smData.psf->Release(); return hr; } + +HRESULT CMenuBand::_CallCB(UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + if (!m_psmc) + return S_FALSE; + + HWND hwnd; + GetWindow(&hwnd); + + SMDATA smData = { 0 }; + smData.punk = (IShellMenu2*)this; + smData.uIdParent = m_uId; + smData.uIdAncestor = m_uIdAncestor; + smData.hwnd = hwnd; + if (m_staticToolbar) + { + smData.hmenu = m_hmenu; + } + smData.pvUserData = NULL; + if (m_SFToolbar) + m_SFToolbar->GetShellFolder(NULL, &smData.pidlFolder, IID_PPV_ARG(IShellFolder, &smData.psf)); + HRESULT hr = m_psmc->CallbackSM(&smData, uMsg, wParam, lParam); + ILFree(smData.pidlFolder); + if (smData.psf) + smData.psf->Release(); + return hr; +} #endif Modified: branches/shell-experiments/base/shell/rshell/CStartMenu.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] Mon Feb 17 18:38:31 2014 @@ -20,7 +20,7 @@ #include "precomp.h" -/* NOTE: The following constants may *NOT* be changed because +/* NOTE: The following constants *MUST NOT* be changed because they're hardcoded and need to be the exact values in order to get the start menu to work! */ #define IDM_PROGRAMS 504
10 years, 10 months
1
0
0
0
[dquintana] 62231: [RSHELL] * CMenuBand: Improve the code structure. * Make the class selection better managed. Thanks Giannis. CORE-7881
by dquintana@svn.reactos.org
Author: dquintana Date: Mon Feb 17 17:16:55 2014 New Revision: 62231 URL:
http://svn.reactos.org/svn/reactos?rev=62231&view=rev
Log: [RSHELL] * CMenuBand: Improve the code structure. * Make the class selection better managed. Thanks Giannis. CORE-7881 Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp branches/shell-experiments/base/shell/rshell/CStartMenu.cpp branches/shell-experiments/base/shell/rshell/precomp.h Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Mon Feb 17 17:16:55 2014 @@ -54,6 +54,8 @@ HRESULT OnHotItemChange(const NMTBHOTITEM * hot); + HRESULT PopupSubMenu(UINT uItem, IShellMenu* childShellMenu); + static LRESULT CALLBACK s_SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); protected: @@ -955,6 +957,72 @@ return S_OK; } +HRESULT CMenuToolbarBase::PopupSubMenu(UINT uItem, IShellMenu* childShellMenu) +{ + RECT rc; + TBBUTTONINFO info = { 0 }; + info.cbSize = sizeof(TBBUTTONINFO); + info.dwMask = 0; + int index = SendMessage(m_hwnd, TB_GETBUTTONINFO, uItem, (LPARAM) &info); + if (index < 0) + return E_FAIL; + if (!SendMessage(m_hwnd, TB_GETITEMRECT, index, (LPARAM) &rc)) + return E_FAIL; + + POINT a = { rc.left, rc.top }; + POINT b = { rc.right, rc.bottom }; + + ClientToScreen(m_hwnd, &a); + ClientToScreen(m_hwnd, &b); + + POINTL pt = { b.x, b.y }; + RECTL rcl = { a.x, a.y, b.x, b.y }; // maybe-TODO: fetch client area of deskbar? + + IBandSite* pBandSite; + IDeskBar* pDeskBar; + + HRESULT hr; + +#ifndef USE_BUILTIN_MENUSITE + hr = CoCreateInstance(CLSID_MenuBandSite, + NULL, + CLSCTX_INPROC_SERVER, + IID_PPV_ARG(IBandSite, &pBandSite)); +#else + hr = CMenuSite_Constructor(IID_PPV_ARG(IBandSite, &pBandSite)); +#endif + if (FAILED(hr)) + return hr; + +#ifndef USE_BUILTIN_MENUDESKBAR + 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 hr; + + hr = pDeskBar->SetClient(pBandSite); + if (FAILED(hr)) + return hr; + + hr = pBandSite->AddBand(childShellMenu); + if (FAILED(hr)) + return hr; + + CComPtr<IMenuPopup> popup; + hr = pDeskBar->QueryInterface(IID_PPV_ARG(IMenuPopup, &popup)); + if (FAILED(hr)) + return hr; + + popup->Popup(&pt, &rcl, MPPF_TOP | MPPF_RIGHT); + + return S_OK; +} + BOOL AllocAndGetMenuString(HMENU hMenu, UINT ItemIDByPosition, WCHAR** String) { @@ -1058,38 +1126,12 @@ HRESULT CMenuStaticToolbar::PopupItem(UINT uItem) { - RECT rc; - TBBUTTONINFO info = { 0 }; - info.cbSize = sizeof(TBBUTTONINFO); - info.dwMask = 0; - int index = SendMessage(m_hwnd, TB_GETBUTTONINFO, uItem, (LPARAM) &info); - if (index < 0) - return E_FAIL; - if (!SendMessage(m_hwnd, TB_GETITEMRECT, index, (LPARAM) &rc)) - return E_FAIL; - - POINT a = { rc.left, rc.top }; - POINT b = { rc.right, rc.bottom }; - - ClientToScreen(m_hwnd, &a); - ClientToScreen(m_hwnd, &b); - - POINTL pt = { b.x, b.y }; - RECTL rcl = { a.x, a.y, b.x, b.y }; // maybe-TODO: fetch client area of deskbar? - CComPtr<IShellMenu> shellMenu; HRESULT hr = m_menuBand->CallCBWithId(uItem, SMC_GETOBJECT, (WPARAM) &IID_IShellMenu, (LPARAM) &shellMenu); if (FAILED(hr)) return hr; - CComPtr<IMenuPopup> popup; - hr = CSubMenu_Constructor(shellMenu, IID_PPV_ARG(IMenuPopup, &popup)); - if (FAILED(hr)) - return hr; - - popup->Popup(&pt, &rcl, MPPF_TOP | MPPF_RIGHT); - - return S_OK; + return PopupSubMenu(uItem, shellMenu); } HRESULT CMenuStaticToolbar::HasSubMenu(UINT uItem) Modified: branches/shell-experiments/base/shell/rshell/CStartMenu.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] Mon Feb 17 17:16:55 2014 @@ -125,7 +125,7 @@ case IDM_DOCUMENTS: csidl = CSIDL_RECENT; break; } -#if 0 +#ifndef USE_BUILTIN_MENUBAND hr = CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER, @@ -262,7 +262,7 @@ IShellFolder *shellFolder; IShellFolder *psfStartMenu; -#if 0 +#ifndef USE_BUILTIN_MENUBAND hr = CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER, @@ -273,7 +273,7 @@ if (FAILED(hr)) return hr; -#if 0 +#ifndef USE_BUILTIN_MENUSITE hr = CoCreateInstance(CLSID_MenuBandSite, NULL, CLSCTX_INPROC_SERVER, @@ -284,7 +284,7 @@ if (FAILED(hr)) return hr; -#if 0 +#ifndef USE_BUILTIN_MENUDESKBAR hr = CoCreateInstance(CLSID_MenuDeskBar, NULL, CLSCTX_INPROC_SERVER, @@ -325,45 +325,3 @@ return pDeskBar->QueryInterface(riid, ppv); } - -extern "C" -HRESULT -CSubMenu_Constructor(IShellMenu * pShellMenu, REFIID riid, void **ppv) -{ - IBandSite* pBandSite; - IDeskBar* pDeskBar; - - HRESULT hr; - -#if 0 - hr = CoCreateInstance(CLSID_MenuBandSite, - NULL, - CLSCTX_INPROC_SERVER, - IID_PPV_ARG(IBandSite, &pBandSite)); -#else - hr = CMenuSite_Constructor(IID_PPV_ARG(IBandSite, &pBandSite)); -#endif - if (FAILED(hr)) - return hr; - -#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 hr; - - hr = pDeskBar->SetClient(pBandSite); - if (FAILED(hr)) - return hr; - - hr = pBandSite->AddBand(pShellMenu); - if (FAILED(hr)) - return hr; - - return pDeskBar->QueryInterface(riid, ppv); -} Modified: branches/shell-experiments/base/shell/rshell/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] Mon Feb 17 17:16:55 2014 @@ -1,3 +1,7 @@ + +#define USE_BUILTIN_MENUDESKBAR +#define USE_BUILTIN_MENUSITE +#define USE_BUILTIN_MENUBAND #include <stdio.h> #include <tchar.h> @@ -33,4 +37,3 @@ 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); -extern "C" HRESULT CSubMenu_Constructor(IShellMenu * pShellMenu, REFIID riid, void **ppv);
10 years, 10 months
1
0
0
0
[tfaber] 62230: [SHELL32] - Fix more casts and stack corruption
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Feb 17 17:01:37 2014 New Revision: 62230 URL:
http://svn.reactos.org/svn/reactos?rev=62230&view=rev
Log: [SHELL32] - Fix more casts and stack corruption Modified: trunk/reactos/dll/win32/shell32/filedefext.cpp trunk/reactos/dll/win32/shell32/folders/fs.cpp trunk/reactos/dll/win32/shell32/folders/fs.h trunk/reactos/dll/win32/shell32/shellole.cpp Modified: trunk/reactos/dll/win32/shell32/filedefext.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/filedefe…
============================================================================== --- trunk/reactos/dll/win32/shell32/filedefext.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/filedefext.cpp [iso-8859-1] Mon Feb 17 17:01:37 2014 @@ -979,7 +979,7 @@ DWORD WINAPI CFileDefExt::_CountFolderAndFilesThreadProc(LPVOID lpParameter) { - _CountFolderAndFilesData *data = reinterpret_cast<_CountFolderAndFilesData*>(lpParameter); + _CountFolderAndFilesData *data = static_cast<_CountFolderAndFilesData*>(lpParameter); DWORD ticks = 0; data->This->CountFolderAndFiles(data->hwndDlg, data->pwszBuf, data->cchBufMax, &ticks); Modified: trunk/reactos/dll/win32/shell32/folders/fs.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/fs.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/fs.cpp [iso-8859-1] Mon Feb 17 17:01:37 2014 @@ -1427,7 +1427,7 @@ { if (SUCCEEDED(pAsyncOperation->GetAsyncMode(&fIsOpAsync)) && fIsOpAsync) { - _DoDropData *data = reinterpret_cast<_DoDropData*> (HeapAlloc(GetProcessHeap(), 0, sizeof(_DoDropData))); + _DoDropData *data = static_cast<_DoDropData*>(HeapAlloc(GetProcessHeap(), 0, sizeof(_DoDropData))); data->This = this; // Need to maintain this class in case the window is closed or the class exists temporarily (when dropping onto a folder). this->AddRef(); @@ -1439,7 +1439,7 @@ data->pdwEffect = *pdwEffect; data->pDataObject->AddRef(); data->pAsyncOperation->StartOperation(NULL); - SHCreateThread(reinterpret_cast<LPTHREAD_START_ROUTINE> (CFSFolder::_DoDropThreadProc), reinterpret_cast<void *> (data), NULL, NULL); + SHCreateThread(CFSFolder::_DoDropThreadProc, data, NULL, NULL); return S_OK; } else @@ -1737,8 +1737,8 @@ return hr; } -DWORD CFSFolder::_DoDropThreadProc(LPVOID lpParameter) { - _DoDropData *data = reinterpret_cast<_DoDropData*>(lpParameter); +DWORD WINAPI CFSFolder::_DoDropThreadProc(LPVOID lpParameter) { + _DoDropData *data = static_cast<_DoDropData*>(lpParameter); HRESULT hr = data->This->_DoDrop(data->pDataObject, data->dwKeyState, data->pt, &data->pdwEffect); //Release the CFSFolder and data object holds in the copying thread. data->pAsyncOperation->EndOperation(hr, NULL, data->pdwEffect); Modified: trunk/reactos/dll/win32/shell32/folders/fs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/fs.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/fs.h [iso-8859-1] Mon Feb 17 17:01:37 2014 @@ -46,7 +46,7 @@ BOOL QueryDrop (DWORD dwKeyState, LPDWORD pdwEffect); void SF_RegisterClipFmt(); BOOL GetUniqueFileName(LPWSTR pwszBasePath, LPCWSTR pwszExt, LPWSTR pwszTarget, BOOL bShortcut); - static DWORD _DoDropThreadProc(LPVOID lpParameter); + static DWORD WINAPI _DoDropThreadProc(LPVOID lpParameter); virtual HRESULT WINAPI _DoDrop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect); public: Modified: trunk/reactos/dll/win32/shell32/shellole.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellole…
============================================================================== --- trunk/reactos/dll/win32/shell32/shellole.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shellole.cpp [iso-8859-1] Mon Feb 17 17:01:37 2014 @@ -600,7 +600,7 @@ case CREATE_ALWAYS: if (SUCCEEDED(hres)) { - reinterpret_cast<IPropertyStorage*>(*ppstg)->Release(); + (*ppstg)->Release(); hres = psstg->Delete(fmtid); if(FAILED(hres)) return hres; @@ -620,7 +620,7 @@ { prop.ulKind = PRSPEC_PROPID; prop.propid = PID_CODEPAGE; - hres = reinterpret_cast<IPropertyStorage*>(*ppstg)->ReadMultiple(1, &prop, &ret); + hres = (*ppstg)->ReadMultiple(1, &prop, &ret); if (FAILED(hres) || ret.vt!=VT_I2) *puCodePage = 0; else
10 years, 10 months
1
0
0
0
[tfaber] 62229: [SHELL32] - Fix some broken casts & stack corruption
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Feb 17 16:53:41 2014 New Revision: 62229 URL:
http://svn.reactos.org/svn/reactos?rev=62229&view=rev
Log: [SHELL32] - Fix some broken casts & stack corruption Modified: trunk/reactos/dll/win32/shell32/filedefext.cpp trunk/reactos/dll/win32/shell32/filedefext.h Modified: trunk/reactos/dll/win32/shell32/filedefext.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/filedefe…
============================================================================== --- trunk/reactos/dll/win32/shell32/filedefext.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/filedefext.cpp [iso-8859-1] Mon Feb 17 16:53:41 2014 @@ -95,7 +95,7 @@ return pwszResult; } - + VS_FIXEDFILEINFO *CFileVersionInfo::GetFixedInfo() { if (!m_pInfo) @@ -532,15 +532,15 @@ { /* For directories files have to be counted */ - _CountFolderAndFilesData *data = reinterpret_cast<_CountFolderAndFilesData*> (HeapAlloc(GetProcessHeap(), 0, sizeof(_CountFolderAndFilesData))); + _CountFolderAndFilesData *data = static_cast<_CountFolderAndFilesData*>(HeapAlloc(GetProcessHeap(), 0, sizeof(_CountFolderAndFilesData))); data->This = this; - data->pwszBuf = reinterpret_cast<LPWSTR> (HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * MAX_PATH)); + data->pwszBuf = static_cast<LPWSTR>(HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * MAX_PATH)); data->cchBufMax = MAX_PATH; data->hwndDlg = hwndDlg; this->AddRef(); StringCchCopyW(data->pwszBuf, MAX_PATH, m_wszPath); - - SHCreateThread(reinterpret_cast<LPTHREAD_START_ROUTINE> (CFileDefExt::_CountFolderAndFilesThreadProc), reinterpret_cast<LPVOID> (data), NULL, NULL); + + SHCreateThread(CFileDefExt::_CountFolderAndFilesThreadProc, data, NULL, NULL); /* Update size field */ if (SH_FormatFileSizeWithBytes(&m_DirSize, wszBuf, _countof(wszBuf))) @@ -683,7 +683,7 @@ if (!MoveFileW(pFileDefExt->m_wszPath, wszBuf)) ERR("MoveFileW failed\n"); } - + SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR); return TRUE; } @@ -866,7 +866,7 @@ CFileDefExt::~CFileDefExt() { - + } HRESULT WINAPI @@ -976,7 +976,7 @@ return E_NOTIMPL; } -DWORD +DWORD WINAPI CFileDefExt::_CountFolderAndFilesThreadProc(LPVOID lpParameter) { _CountFolderAndFilesData *data = reinterpret_cast<_CountFolderAndFilesData*>(lpParameter); Modified: trunk/reactos/dll/win32/shell32/filedefext.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/filedefe…
============================================================================== --- trunk/reactos/dll/win32/shell32/filedefext.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/filedefext.h [iso-8859-1] Mon Feb 17 16:53:41 2014 @@ -83,7 +83,7 @@ DWORD m_cFolders; ULARGE_INTEGER m_DirSize; - static DWORD _CountFolderAndFilesThreadProc(LPVOID lpParameter); + static DWORD WINAPI _CountFolderAndFilesThreadProc(LPVOID lpParameter); public: CFileDefExt();
10 years, 10 months
1
0
0
0
[dquintana] 62228: [RSHELL] * CMenuBand: Implement PopupItem for static menus. * CMenuDeskBar: Initialize m_Banner. * CStartMenu: Create CSubMenu_Constructor function that creates submenus (needs a...
by dquintana@svn.reactos.org
Author: dquintana Date: Mon Feb 17 16:41:10 2014 New Revision: 62228 URL:
http://svn.reactos.org/svn/reactos?rev=62228&view=rev
Log: [RSHELL] * CMenuBand: Implement PopupItem for static menus. * CMenuDeskBar: Initialize m_Banner. * CStartMenu: Create CSubMenu_Constructor function that creates submenus (needs a better name/location). * Misc. code style changes. CORE-7881 Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp branches/shell-experiments/base/shell/rshell/CStartMenu.cpp branches/shell-experiments/base/shell/rshell/precomp.h branches/shell-experiments/base/shell/rshell/wraplog.cpp Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Mon Feb 17 16:41:10 2014 @@ -44,7 +44,7 @@ HRESULT GetWindow(HWND *phwnd); HRESULT ShowWindow(BOOL fShow); HRESULT Close(); - + BOOL IsWindowOwner(HWND hwnd) { return m_hwnd && m_hwnd == hwnd; } virtual HRESULT FillToolbar() = 0; @@ -897,7 +897,7 @@ } SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this); - m_SubclassOld = (WNDPROC)SetWindowLongPtr(m_hwnd, GWLP_WNDPROC, (LONG_PTR)CMenuToolbarBase::s_SubclassProc); + m_SubclassOld = (WNDPROC) SetWindowLongPtr(m_hwnd, GWLP_WNDPROC, (LONG_PTR) CMenuToolbarBase::s_SubclassProc); return S_OK; } @@ -1030,7 +1030,7 @@ tbb.fsStyle |= BTNS_WHOLEDROPDOWN; tbb.iString = (INT_PTR) MenuString; tbb.idCommand = info.wID; - + SMINFO sminfo; if (info.wID >= 0 && SUCCEEDED(m_menuBand->CallCBWithId(info.wID, SMC_GETINFO, 0, (LPARAM) &sminfo))) { @@ -1067,10 +1067,27 @@ return E_FAIL; if (!SendMessage(m_hwnd, TB_GETITEMRECT, index, (LPARAM) &rc)) return E_FAIL; - int px = rc.right; - int py = rc.bottom; - - // TODO: Create popup CMenuDeskBar + + POINT a = { rc.left, rc.top }; + POINT b = { rc.right, rc.bottom }; + + ClientToScreen(m_hwnd, &a); + ClientToScreen(m_hwnd, &b); + + POINTL pt = { b.x, b.y }; + RECTL rcl = { a.x, a.y, b.x, b.y }; // maybe-TODO: fetch client area of deskbar? + + CComPtr<IShellMenu> shellMenu; + HRESULT hr = m_menuBand->CallCBWithId(uItem, SMC_GETOBJECT, (WPARAM) &IID_IShellMenu, (LPARAM) &shellMenu); + if (FAILED(hr)) + return hr; + + CComPtr<IMenuPopup> popup; + hr = CSubMenu_Constructor(shellMenu, IID_PPV_ARG(IMenuPopup, &popup)); + if (FAILED(hr)) + return hr; + + popup->Popup(&pt, &rcl, MPPF_TOP | MPPF_RIGHT); return S_OK; } @@ -1179,7 +1196,7 @@ } HRESULT CMenuSFToolbar::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult) { -// return m_menuBand->CallCBWithPidl(GetPidlFromId(wParam), SMC_SFEXEC, 0, 0); + // TODO: return m_menuBand->CallCBWithPidl(GetPidlFromId(wParam), SMC_SFEXEC, 0, 0); return S_OK; } @@ -1951,5 +1968,4 @@ smData.psf->Release(); return hr; } - #endif Modified: branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] Mon Feb 17 16:41:10 2014 @@ -446,7 +446,8 @@ m_Vertical(true), m_Visible(false), m_NeededSize(200), - m_Tracking(false) + m_Tracking(false), + m_Banner(NULL) { } Modified: branches/shell-experiments/base/shell/rshell/CStartMenu.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] Mon Feb 17 16:41:10 2014 @@ -125,10 +125,14 @@ case IDM_DOCUMENTS: csidl = CSIDL_RECENT; break; } +#if 0 hr = CoCreateInstance(CLSID_MenuBand, - NULL, - CLSCTX_INPROC_SERVER, - IID_PPV_ARG(IShellMenu,&pShellMenu)); + NULL, + CLSCTX_INPROC_SERVER, + IID_PPV_ARG(IShellMenu, &pShellMenu)); +#else + hr = CMenuBand_Constructor(IID_PPV_ARG(IShellMenu, &pShellMenu)); +#endif hr = pShellMenu->Initialize(this, 0, ANCESTORDEFAULT, SMINIT_VERTICAL); @@ -252,7 +256,6 @@ IShellMenu* pShellMenu; IBandSite* pBandSite; IDeskBar* pDeskBar; - IShellMenuCallback* callback; LPITEMIDLIST pidlStartMenu; HRESULT hr; @@ -268,7 +271,7 @@ hr = CMenuBand_Constructor(IID_PPV_ARG(IShellMenu, &pShellMenu)); #endif if (FAILED(hr)) - return NULL; + return hr; #if 0 hr = CoCreateInstance(CLSID_MenuBandSite, @@ -279,7 +282,7 @@ hr = CMenuSite_Constructor(IID_PPV_ARG(IBandSite, &pBandSite)); #endif if (FAILED(hr)) - return NULL; + return hr; #if 0 hr = CoCreateInstance(CLSID_MenuDeskBar, @@ -290,23 +293,18 @@ hr = CMenuDeskBar_Constructor(IID_PPV_ARG(IDeskBar, &pDeskBar)); #endif if (FAILED(hr)) - return NULL; + return hr; CComObject<CShellMenuCallback> *pCallback; hr = CComObject<CShellMenuCallback>::CreateInstance(&pCallback); if (FAILED(hr)) - return FALSE; + return hr; pCallback->AddRef(); // CreateInstance returns object with 0 ref count */ pCallback->Initialize(pShellMenu, pBandSite, pDeskBar); - callback = pCallback; - - hr = CShellMenuCallback::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IShellMenuCallback, &callback)); - if (FAILED(hr)) - return NULL; pShellMenu->Initialize(pCallback, -1, 0, SMINIT_TOPLEVEL | SMINIT_VERTICAL); if (FAILED(hr)) - return NULL; + return hr; /* FIXME: Use CLSID_MergedFolder class and IID_IAugmentedShellFolder2 interface here */ /* CLSID_MergedFolder 26fdc864-be88-46e7-9235-032d8ea5162e */ @@ -319,11 +317,53 @@ hr = pDeskBar->SetClient(pBandSite); if (FAILED(hr)) - return NULL; + return hr; hr = pBandSite->AddBand(pShellMenu); if (FAILED(hr)) - return NULL; + return hr; return pDeskBar->QueryInterface(riid, ppv); } + +extern "C" +HRESULT +CSubMenu_Constructor(IShellMenu * pShellMenu, REFIID riid, void **ppv) +{ + IBandSite* pBandSite; + IDeskBar* pDeskBar; + + HRESULT hr; + +#if 0 + hr = CoCreateInstance(CLSID_MenuBandSite, + NULL, + CLSCTX_INPROC_SERVER, + IID_PPV_ARG(IBandSite, &pBandSite)); +#else + hr = CMenuSite_Constructor(IID_PPV_ARG(IBandSite, &pBandSite)); +#endif + if (FAILED(hr)) + return hr; + +#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 hr; + + hr = pDeskBar->SetClient(pBandSite); + if (FAILED(hr)) + return hr; + + hr = pBandSite->AddBand(pShellMenu); + if (FAILED(hr)) + return hr; + + return pDeskBar->QueryInterface(riid, ppv); +} Modified: branches/shell-experiments/base/shell/rshell/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] Mon Feb 17 16:41:10 2014 @@ -32,4 +32,5 @@ 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); +extern "C" HRESULT CMenuBand_Constructor(REFIID riid, LPVOID *ppv); +extern "C" HRESULT CSubMenu_Constructor(IShellMenu * pShellMenu, REFIID riid, void **ppv); Modified: branches/shell-experiments/base/shell/rshell/wraplog.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/wraplog.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/wraplog.cpp [iso-8859-1] Mon Feb 17 16:41:10 2014 @@ -2,11 +2,11 @@ #include "wraplog.h" #include <stdio.h> -static UINT openCount = 0; -static UINT callLevel; +static INT openCount = 0; +static INT callLevel; static FILE*log; -static UINT nTemps; +static INT nTemps; static CHAR strTemp[10][256]; void WrapLogOpen()
10 years, 10 months
1
0
0
0
[dquintana] 62227: [RSHELL] * CMenuDeskBar: Use the proper value for style in AdjustWindowRect. * CMenuBand: Implement submenu hot-tracking timer. Not functional yet (submenu creation not implement...
by dquintana@svn.reactos.org
Author: dquintana Date: Mon Feb 17 15:38:55 2014 New Revision: 62227 URL:
http://svn.reactos.org/svn/reactos?rev=62227&view=rev
Log: [RSHELL] * CMenuDeskBar: Use the proper value for style in AdjustWindowRect. * CMenuBand: Implement submenu hot-tracking timer. Not functional yet (submenu creation not implemented). CORE-7881 Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Mon Feb 17 15:38:55 2014 @@ -19,10 +19,16 @@ */ #include "precomp.h" #include "wraplog.h" +#include <windowsx.h> WINE_DEFAULT_DEBUG_CHANNEL(CMenuBand); #define WRAP_LOG 0 + +#define TBSTYLE_EX_VERTICAL 4 + +#define TIMERID_HOTTRACK 1 +#define SUBCLASS_ID_MENUBAND 1 extern "C" BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList); @@ -38,17 +44,28 @@ HRESULT GetWindow(HWND *phwnd); HRESULT ShowWindow(BOOL fShow); HRESULT Close(); + + BOOL IsWindowOwner(HWND hwnd) { return m_hwnd && m_hwnd == hwnd; } virtual HRESULT FillToolbar() = 0; + virtual HRESULT PopupItem(UINT uItem) = 0; + virtual HRESULT HasSubMenu(UINT uItem) = 0; virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult) = 0; + HRESULT OnHotItemChange(const NMTBHOTITEM * hot); + + static LRESULT CALLBACK s_SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); protected: static const UINT WM_USER_SHOWPOPUPMENU = WM_USER + 1; + + LRESULT CALLBACK SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); CMenuBand *m_menuBand; HWND m_hwnd; DWORD m_dwMenuFlags; + UINT m_hotItem; + WNDPROC m_SubclassOld; }; class CMenuStaticToolbar : public CMenuToolbarBase @@ -61,6 +78,8 @@ HRESULT GetMenu(HMENU *phmenu, HWND *phwnd, DWORD *pdwFlags); virtual HRESULT FillToolbar(); + virtual HRESULT PopupItem(UINT uItem); + virtual HRESULT HasSubMenu(UINT uItem); virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult); private: HMENU m_hmenu; @@ -76,6 +95,8 @@ HRESULT GetShellFolder(DWORD *pdwFlags, LPITEMIDLIST *ppidl, REFIID riid, void **ppv); virtual HRESULT FillToolbar(); + virtual HRESULT PopupItem(UINT uItem); + virtual HRESULT HasSubMenu(UINT uItem); virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult); @@ -786,10 +807,6 @@ } #else -#include <windowsx.h> - -#define TBSTYLE_EX_VERTICAL 4 - CMenuToolbarBase::CMenuToolbarBase(CMenuBand *menuBand) : m_menuBand(menuBand), m_hwnd(NULL), @@ -879,6 +896,9 @@ SendMessageW(m_hwnd, TB_SETIMAGELIST, 0, (LPARAM) ilSmall); } + SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this); + m_SubclassOld = (WNDPROC)SetWindowLongPtr(m_hwnd, GWLP_WNDPROC, (LONG_PTR)CMenuToolbarBase::s_SubclassProc); + return S_OK; } @@ -888,6 +908,49 @@ return E_FAIL; *phwnd = m_hwnd; + + return S_OK; +} + +LRESULT CALLBACK CMenuToolbarBase::s_SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + CMenuToolbarBase * pthis = (CMenuToolbarBase *) GetWindowLongPtr(hWnd, GWLP_USERDATA); + return pthis->SubclassProc(hWnd, uMsg, wParam, lParam); +} + +LRESULT CMenuToolbarBase::SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) + { + case WM_TIMER: + if (wParam == TIMERID_HOTTRACK) + { + PopupItem(m_hotItem); + KillTimer(hWnd, TIMERID_HOTTRACK); + } + } + + return m_SubclassOld(hWnd, uMsg, wParam, lParam); +} + +HRESULT CMenuToolbarBase::OnHotItemChange(const NMTBHOTITEM * hot) +{ + if (hot->dwFlags & HICF_LEAVING) + { + KillTimer(m_hwnd, TIMERID_HOTTRACK); + } + else if (m_hotItem != hot->idNew) + { + if (HasSubMenu(hot->idNew) == S_OK) + { + DWORD elapsed; + SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &elapsed, 0); + + m_hotItem = hot->idNew; + + SetTimer(m_hwnd, TIMERID_HOTTRACK, elapsed, NULL); + } + } return S_OK; } @@ -964,8 +1027,8 @@ if (!AllocAndGetMenuString(m_hmenu, i, &MenuString)) return E_OUTOFMEMORY; if (::GetSubMenu(m_hmenu, i) != NULL) - tbb.fsStyle |= BTNS_DROPDOWN; - tbb.iString = (INT_PTR) MenuString; + tbb.fsStyle |= BTNS_WHOLEDROPDOWN; + tbb.iString = (INT_PTR) MenuString; tbb.idCommand = info.wID; SMINFO sminfo; @@ -988,6 +1051,41 @@ return S_OK; } +HRESULT CMenuStaticToolbar::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult) +{ + return m_menuBand->CallCBWithId(wParam, SMC_EXEC, 0, 0); +} + +HRESULT CMenuStaticToolbar::PopupItem(UINT uItem) +{ + RECT rc; + TBBUTTONINFO info = { 0 }; + info.cbSize = sizeof(TBBUTTONINFO); + info.dwMask = 0; + int index = SendMessage(m_hwnd, TB_GETBUTTONINFO, uItem, (LPARAM) &info); + if (index < 0) + return E_FAIL; + if (!SendMessage(m_hwnd, TB_GETITEMRECT, index, (LPARAM) &rc)) + return E_FAIL; + int px = rc.right; + int py = rc.bottom; + + // TODO: Create popup CMenuDeskBar + + return S_OK; +} + +HRESULT CMenuStaticToolbar::HasSubMenu(UINT uItem) +{ + TBBUTTONINFO info = { 0 }; + info.cbSize = sizeof(TBBUTTONINFO); + info.dwMask = 0; + int index = SendMessage(m_hwnd, TB_GETBUTTONINFO, uItem, (LPARAM) &info); + if (index < 0) + return E_FAIL; + return ::GetSubMenu(m_hmenu, index) ? S_OK : S_FALSE; +} + CMenuSFToolbar::CMenuSFToolbar(CMenuBand * menuBand) : CMenuToolbarBase(menuBand), m_shellFolder(NULL) @@ -1079,15 +1177,20 @@ return hr; } - -HRESULT CMenuStaticToolbar::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult) -{ - return m_menuBand->CallCBWithId(wParam, SMC_EXEC, 0, 0); -} HRESULT CMenuSFToolbar::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult) { // return m_menuBand->CallCBWithPidl(GetPidlFromId(wParam), SMC_SFEXEC, 0, 0); return S_OK; +} + +HRESULT CMenuSFToolbar::PopupItem(UINT uItem) +{ + return S_OK; +} + +HRESULT CMenuSFToolbar::HasSubMenu(UINT uItem) +{ + return S_FALSE; // GetSubMenu(m_hmenu, uItem) ? S_OK : S_FALSE; } CMenuBand::CMenuBand() : @@ -1370,7 +1473,7 @@ if (hwndStatic) SendMessageW(hwndStatic, TB_GETMAXSIZE, 0, (LPARAM) &sizeStatic); if (hwndShlFld) SendMessageW(hwndShlFld, TB_GETMAXSIZE, 0, (LPARAM) &sizeShlFld); - pdbi->ptMaxSize.x = sizeStatic.cx + sizeShlFld.cx; // ignored + pdbi->ptMaxSize.x = max(sizeStatic.cx, sizeShlFld.cx); // ignored pdbi->ptMaxSize.y = sizeStatic.cy + sizeShlFld.cy; } if (pdbi->dwMask & DBIM_INTEGRAL) @@ -1385,7 +1488,7 @@ if (hwndStatic) SendMessageW(hwndStatic, TB_GETIDEALSIZE, FALSE, (LPARAM) &sizeStatic); if (hwndShlFld) SendMessageW(hwndShlFld, TB_GETIDEALSIZE, FALSE, (LPARAM) &sizeShlFld); - pdbi->ptActual.x = sizeStatic.cx + sizeShlFld.cx; + pdbi->ptActual.x = max(sizeStatic.cx, sizeShlFld.cx); if (hwndStatic) SendMessageW(hwndStatic, TB_GETIDEALSIZE, TRUE, (LPARAM) &sizeStatic); if (hwndShlFld) SendMessageW(hwndShlFld, TB_GETIDEALSIZE, TRUE, (LPARAM) &sizeShlFld); @@ -1628,41 +1731,44 @@ HRESULT STDMETHODCALLTYPE CMenuBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) { - HWND hwndStatic = NULL; - HWND hwndShlFld = NULL; - HRESULT hr; - *theResult = 0; switch (uMsg) { case WM_COMMAND: - if (m_staticToolbar != NULL) - hr = m_staticToolbar->GetWindow(&hwndStatic); - if (FAILED(hr)) - return hr; - - if (hWnd == hwndStatic) + if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd)) { return m_staticToolbar->OnCommand(wParam, lParam, theResult); } - if (m_SFToolbar != NULL) - hr = m_SFToolbar->GetWindow(&hwndShlFld); - if (FAILED(hr)) - return hr; - - if (hWnd == hwndShlFld) + if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd)) { return m_SFToolbar->OnCommand(wParam, lParam, theResult); } return S_OK; + case WM_NOTIFY: NMHDR * hdr = (LPNMHDR) lParam; NMTBCUSTOMDRAW * cdraw; + NMTBHOTITEM * hot; switch (hdr->code) { + case TBN_HOTITEMCHANGE: + hot = (NMTBHOTITEM*) hdr; + + if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd)) + { + return m_staticToolbar->OnHotItemChange(hot); + } + + if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd)) + { + return m_SFToolbar->OnHotItemChange(hot); + } + + return S_OK; + case NM_CUSTOMDRAW: cdraw = (LPNMTBCUSTOMDRAW) hdr; switch (cdraw->nmcd.dwDrawStage) @@ -1697,7 +1803,7 @@ break; } - *theResult = TBCDRF_NOBACKGROUND | TBCDRF_NOEDGES | TBCDRF_NOETCHEDEFFECT | TBCDRF_HILITEHOTTRACK; + *theResult = TBCDRF_NOBACKGROUND | TBCDRF_NOEDGES | TBCDRF_NOETCHEDEFFECT | TBCDRF_HILITEHOTTRACK | TBCDRF_NOOFFSET; return S_OK; } return S_OK; @@ -1710,24 +1816,10 @@ HRESULT STDMETHODCALLTYPE CMenuBand::IsWindowOwner(HWND hWnd) { - HWND hwndStatic = NULL; - HWND hwndShlFld = NULL; - HRESULT hr; - - if (m_staticToolbar != NULL) - hr = m_staticToolbar->GetWindow(&hwndStatic); - if (FAILED(hr)) - return hr; - - if (hWnd == hwndStatic) + if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd)) return S_OK; - if (m_SFToolbar != NULL) - hr = m_SFToolbar->GetWindow(&hwndShlFld); - if (FAILED(hr)) - return hr; - - if (hWnd == hwndShlFld) + if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd)) return S_OK; return S_FALSE; Modified: branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] Mon Feb 17 15:38:55 2014 @@ -754,7 +754,7 @@ if (FAILED(hr)) return hr; - ::AdjustWindowRect(&rc, WS_DLGFRAME, FALSE); + ::AdjustWindowRect(&rc, ::GetWindowLong(m_hWnd, GWL_STYLE), FALSE); rc.right -= rc.left; rc.bottom -= rc.top;
10 years, 10 months
1
0
0
0
[dquintana] 62226: [RSHELL] * CMenuBand: Handle WM_COMMAND and run SMC_EXEC for static menu items (Run, Shutdown). CORE-7881
by dquintana@svn.reactos.org
Author: dquintana Date: Mon Feb 17 11:20:35 2014 New Revision: 62226 URL:
http://svn.reactos.org/svn/reactos?rev=62226&view=rev
Log: [RSHELL] * CMenuBand: Handle WM_COMMAND and run SMC_EXEC for static menu items (Run, Shutdown). CORE-7881 Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Mon Feb 17 11:20:35 2014 @@ -40,6 +40,7 @@ HRESULT Close(); virtual HRESULT FillToolbar() = 0; + virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult) = 0; protected: @@ -60,7 +61,7 @@ HRESULT GetMenu(HMENU *phmenu, HWND *phwnd, DWORD *pdwFlags); virtual HRESULT FillToolbar(); - + virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult); private: HMENU m_hmenu; }; @@ -75,6 +76,8 @@ HRESULT GetShellFolder(DWORD *pdwFlags, LPITEMIDLIST *ppidl, REFIID riid, void **ppv); virtual HRESULT FillToolbar(); + virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult); + private: @@ -825,7 +828,7 @@ LONG tbStyles = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TBSTYLE_TOOLTIPS | TBSTYLE_TRANSPARENT | TBSTYLE_REGISTERDROP | TBSTYLE_LIST | TBSTYLE_FLAT | CCS_NODIVIDER | CCS_NOPARENTALIGN | CCS_NORESIZE | CCS_TOP; - LONG tbExStyles = TBSTYLE_EX_DOUBLEBUFFER | TBSTYLE_EX_DRAWDDARROWS; + LONG tbExStyles = TBSTYLE_EX_DOUBLEBUFFER; if (dwFlags & SMINIT_VERTICAL) { @@ -960,7 +963,8 @@ { if (!AllocAndGetMenuString(m_hmenu, i, &MenuString)) return E_OUTOFMEMORY; - tbb.fsStyle |= BTNS_DROPDOWN; + if (::GetSubMenu(m_hmenu, i) != NULL) + tbb.fsStyle |= BTNS_DROPDOWN; tbb.iString = (INT_PTR) MenuString; tbb.idCommand = info.wID; @@ -1076,6 +1080,16 @@ return hr; } +HRESULT CMenuStaticToolbar::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult) +{ + return m_menuBand->CallCBWithId(wParam, SMC_EXEC, 0, 0); +} +HRESULT CMenuSFToolbar::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult) +{ +// return m_menuBand->CallCBWithPidl(GetPidlFromId(wParam), SMC_SFEXEC, 0, 0); + return S_OK; +} + CMenuBand::CMenuBand() : m_site(NULL), m_psmc(NULL), @@ -1614,9 +1628,37 @@ HRESULT STDMETHODCALLTYPE CMenuBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) { + HWND hwndStatic = NULL; + HWND hwndShlFld = NULL; + HRESULT hr; + *theResult = 0; - if (uMsg == WM_NOTIFY) - { + switch (uMsg) + { + case WM_COMMAND: + + if (m_staticToolbar != NULL) + hr = m_staticToolbar->GetWindow(&hwndStatic); + if (FAILED(hr)) + return hr; + + if (hWnd == hwndStatic) + { + return m_staticToolbar->OnCommand(wParam, lParam, theResult); + } + + if (m_SFToolbar != NULL) + hr = m_SFToolbar->GetWindow(&hwndShlFld); + if (FAILED(hr)) + return hr; + + if (hWnd == hwndShlFld) + { + return m_SFToolbar->OnCommand(wParam, lParam, theResult); + } + + return S_OK; + case WM_NOTIFY: NMHDR * hdr = (LPNMHDR) lParam; NMTBCUSTOMDRAW * cdraw; switch (hdr->code) @@ -1661,8 +1703,8 @@ return S_OK; } return S_OK; - - } + } + return S_FALSE; }
10 years, 10 months
1
0
0
0
[gadamopoulos] 62225: [RSHELL] - CMenuDeskBar: Implement showing a shadow. Implement closing the menu when it loses focus (this only works with the stock menu band for now)
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Mon Feb 17 10:42:52 2014 New Revision: 62225 URL:
http://svn.reactos.org/svn/reactos?rev=62225&view=rev
Log: [RSHELL] - CMenuDeskBar: Implement showing a shadow. Implement closing the menu when it loses focus (this only works with the stock menu band for now) Modified: branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp Modified: branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] Mon Feb 17 10:42:52 2014 @@ -127,7 +127,7 @@ DECLARE_PROTECT_FINAL_CONSTRUCT() #if !WRAP_LOG - DECLARE_WND_CLASS_EX(_T("BaseBar"), 0, COLOR_3DFACE) + DECLARE_WND_CLASS_EX(_T("BaseBar"), CS_SAVEBITS | CS_DROPSHADOW, COLOR_3DFACE) BEGIN_MSG_MAP(CMenuDeskBar) MESSAGE_HANDLER(WM_SIZE, OnSize) @@ -777,11 +777,7 @@ BOOL bHandled; OnSize(WM_SIZE, 0, 0, bHandled); - hr = m_Client->QueryInterface(IID_PPV_ARG(IInputObject, &io)); - if (FAILED(hr)) - return hr; - - io->UIActivateIO(TRUE, NULL); + UIActivateIO(TRUE, NULL); return S_OK; } @@ -832,6 +828,23 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnSelect( DWORD dwSelectType) { + if (dwSelectType == MPOS_FULLCANCEL) + { + CComPtr<IDeskBarClient> dbc; + + HRESULT hr = m_Client->QueryInterface(IID_PPV_ARG(IDeskBarClient, &dbc)); + if (FAILED(hr)) + return hr; + + hr = dbc->UIActivateDBC(FALSE); + if (FAILED(hr)) + return hr; + + SetWindowPos(m_hWnd, 0,0,0,0, SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER); + + UIActivateIO(FALSE, NULL); + } + return S_OK; }
10 years, 10 months
1
0
0
0
[jimtabor] 62224: [RosApps|WineFile] - update some resource files, please review and update them.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Feb 17 04:18:52 2014 New Revision: 62224 URL:
http://svn.reactos.org/svn/reactos?rev=62224&view=rev
Log: [RosApps|WineFile] - update some resource files, please review and update them. Modified: trunk/rosapps/applications/winfile/Cs.rc trunk/rosapps/applications/winfile/Da.rc trunk/rosapps/applications/winfile/De.rc trunk/rosapps/applications/winfile/En.rc trunk/rosapps/applications/winfile/Es.rc trunk/rosapps/applications/winfile/Fr.rc trunk/rosapps/applications/winfile/It.rc trunk/rosapps/applications/winfile/Ja.rc trunk/rosapps/applications/winfile/Ko.rc trunk/rosapps/applications/winfile/Lt.rc trunk/rosapps/applications/winfile/Nl.rc trunk/rosapps/applications/winfile/No.rc trunk/rosapps/applications/winfile/Pl.rc trunk/rosapps/applications/winfile/Pt.rc trunk/rosapps/applications/winfile/Ro.rc trunk/rosapps/applications/winfile/Ru.rc trunk/rosapps/applications/winfile/Si.rc trunk/rosapps/applications/winfile/Sv.rc trunk/rosapps/applications/winfile/Tr.rc trunk/rosapps/applications/winfile/Uk.rc Modified: trunk/rosapps/applications/winfile/Cs.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Cs.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Cs.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Cs.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -194,5 +194,8 @@ IDS_COL_ATTR "Atributy" IDS_COL_SEC "Zabezpeèení" - IDS_FREE_SPACE_FMT "%s z %s volného" -} + IDS_FREE_SPACE_FMT "%1 z %2 volného" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/Da.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Da.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Da.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Da.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -241,5 +241,8 @@ IDS_COL_ATTR "Attributter" IDS_COL_SEC "Sikkerhed" - IDS_FREE_SPACE_FMT "%s af %s ledig" -} + IDS_FREE_SPACE_FMT "%1 af %2 ledig" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/De.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/De.rc…
============================================================================== --- trunk/rosapps/applications/winfile/De.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/De.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -241,5 +241,8 @@ IDS_COL_ATTR "Attribute" IDS_COL_SEC "Sicherheit" - IDS_FREE_SPACE_FMT "%s von %s frei" -} + IDS_FREE_SPACE_FMT "%1 von %2 frei" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/En.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/En.rc…
============================================================================== --- trunk/rosapps/applications/winfile/En.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/En.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -243,5 +243,8 @@ IDS_COL_ATTR "Attributes" IDS_COL_SEC "Security" - IDS_FREE_SPACE_FMT "%s of %s free" -} + IDS_FREE_SPACE_FMT "%1 of %2 free" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/Es.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Es.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Es.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Es.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -241,5 +241,8 @@ IDS_COL_ATTR "Atributos" IDS_COL_SEC "Seguridad" - IDS_FREE_SPACE_FMT "%s de %s libre" -} + IDS_FREE_SPACE_FMT "%1 de %2 libre" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/Fr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Fr.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Fr.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Fr.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -248,5 +248,8 @@ IDS_COL_ATTR "Attributs" IDS_COL_SEC "Sécurité" - IDS_FREE_SPACE_FMT "%s sur %s libre" -} + IDS_FREE_SPACE_FMT "%1 sur %2 libre" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/It.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/It.rc…
============================================================================== --- trunk/rosapps/applications/winfile/It.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/It.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -248,5 +248,8 @@ IDS_COL_ATTR "Attributi" IDS_COL_SEC "Sicurezza" - IDS_FREE_SPACE_FMT "liberi %s di %s" -} + IDS_FREE_SPACE_FMT "liberi %1 di %2" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/Ja.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Ja.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Ja.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Ja.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -246,5 +246,8 @@ IDS_COL_ATTR "å±æ§" IDS_COL_SEC "ã»ãã¥ãªãã£" - IDS_FREE_SPACE_FMT "%s of %s free" -} + IDS_FREE_SPACE_FMT "%1 of %2 free" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/Ko.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Ko.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Ko.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Ko.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -245,5 +245,8 @@ IDS_COL_ATTR "¼Ó¼º" IDS_COL_SEC "º¸¾È" - IDS_FREE_SPACE_FMT "%s of %s »ç¿ë°¡´É" -} + IDS_FREE_SPACE_FMT "%1 of %2 »ç¿ë°¡´É" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/Lt.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Lt.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Lt.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Lt.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -244,5 +244,8 @@ IDS_COL_ATTR "Požymiai" IDS_COL_SEC "Saugumas" - IDS_FREE_SPACE_FMT "%s iš %s laisva" -} + IDS_FREE_SPACE_FMT "%1 iš %2 laisva" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/Nl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Nl.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Nl.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Nl.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -242,5 +242,8 @@ IDS_COL_ATTR "Attributen" IDS_COL_SEC "Beveiliging" - IDS_FREE_SPACE_FMT "%s van %s vrij" -} + IDS_FREE_SPACE_FMT "%1 van %2 vrij" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/No.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/No.rc…
============================================================================== --- trunk/rosapps/applications/winfile/No.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/No.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -241,5 +241,8 @@ IDS_COL_ATTR "Attributter" IDS_COL_SEC "Sikkerhet" - IDS_FREE_SPACE_FMT "%s av %s ledig" -} + IDS_FREE_SPACE_FMT "%1 av %2 ledig" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/Pl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Pl.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Pl.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Pl.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -243,5 +243,8 @@ IDS_COL_ATTR "Atrybuty" IDS_COL_SEC "Prawa dostêpu" - IDS_FREE_SPACE_FMT "%s z %s wolne" -} + IDS_FREE_SPACE_FMT "%1 z %2 wolne" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/Pt.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Pt.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Pt.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Pt.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -488,5 +488,8 @@ IDS_COL_ATTR "Atributos" IDS_COL_SEC "Segurança" - IDS_FREE_SPACE_FMT "%s de %s livre" -} + IDS_FREE_SPACE_FMT "%1 de %2 livre" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/Ro.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Ro.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Ro.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Ro.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -52,11 +52,7 @@ MENUITEM "CÄ&utare...", 104 MENUITEM "&Selectare fiÈiere...", 116 MENUITEM SEPARATOR -#ifndef _NO_EXTENSIONS - MENUITEM "Ãnc&hide\Alt+X", ID_FILE_EXIT -#else MENUITEM "Ãnc&hide", ID_FILE_EXIT -#endif } POPUP "&Disc" { @@ -245,5 +241,8 @@ IDS_COL_ATTR "Atribute" IDS_COL_SEC "Securitate" - IDS_FREE_SPACE_FMT "%s din %s liber" -} + IDS_FREE_SPACE_FMT "%1 din %2 liber" + IDS_UNIT_KB "ko" + IDS_UNIT_MB "Mo" + IDS_UNIT_GB "Go" +} Modified: trunk/rosapps/applications/winfile/Ru.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Ru.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Ru.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Ru.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -244,5 +244,8 @@ IDS_COL_ATTR "ÐÑÑибÑÑÑ" IDS_COL_SEC "ÐезопаÑноÑÑÑ" - IDS_FREE_SPACE_FMT "%s из %s Ñвободно" -} + IDS_FREE_SPACE_FMT "%1 из %2 Ñвободно" + IDS_UNIT_KB "ÐZÐQ" + IDS_UNIT_MB "Ð\ÐQ" + IDS_UNIT_GB "ÐSÐQ" +} Modified: trunk/rosapps/applications/winfile/Si.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Si.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Si.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Si.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -243,5 +243,8 @@ IDS_COL_ATTR "Attributi" IDS_COL_SEC "Varnost" - IDS_FREE_SPACE_FMT "Prosto: %s od %s" -} + IDS_FREE_SPACE_FMT "Prosto: %1 od %2" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/Sv.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Sv.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Sv.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Sv.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -243,5 +243,8 @@ IDS_COL_ATTR "Attribut" IDS_COL_SEC "Säkerhet" - IDS_FREE_SPACE_FMT "%s av %s ledigt" -} + IDS_FREE_SPACE_FMT "%1 av %2 ledigt" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/Tr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Tr.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Tr.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Tr.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -241,5 +241,8 @@ IDS_COL_ATTR "Özellikler" IDS_COL_SEC "Güvenlik" - IDS_FREE_SPACE_FMT "%s / %s boþ" -} + IDS_FREE_SPACE_FMT "%1 / %2 boþ" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/applications/winfile/Uk.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Uk.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Uk.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Uk.rc [iso-8859-1] Mon Feb 17 04:18:52 2014 @@ -247,5 +247,8 @@ IDS_COL_ATTR "ÐÑÑибÑÑи" IDS_COL_SEC "Ðезпека" - IDS_FREE_SPACE_FMT "%s з %s вÑлÑно" -} + IDS_FREE_SPACE_FMT "%1 з %2 вÑлÑно" + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +}
10 years, 10 months
1
0
0
0
[gadamopoulos] 62223: [rshell] - CMenuBand: Fix the size of the separators by setting iBitmap to 0 (which acts as the width of the separator). - CMenuDeskBar: Create the window only in CMenuDeskBar...
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Sun Feb 16 21:53:21 2014 New Revision: 62223 URL:
http://svn.reactos.org/svn/reactos?rev=62223&view=rev
Log: [rshell] - CMenuBand: Fix the size of the separators by setting iBitmap to 0 (which acts as the width of the separator). - CMenuDeskBar: Create the window only in CMenuDeskBar::SetClient and not in SetSite. Greatly simplify SetSite. Make sure that WS_EX_TOPMOST isn't removed when we call SetWindowPos Do not forward requests for the SID_SMenuPopup service to the taskbar as this causes the menu band to capture the mouse for the taskbar and not the desk bar Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Sun Feb 16 21:53:21 2014 @@ -940,14 +940,14 @@ HRESULT CMenuStaticToolbar::FillToolbar() { int i; - PWSTR MenuString; - int ic = GetMenuItemCount(m_hmenu); for (i = 0; i < ic; i++) { MENUITEMINFOW info; TBBUTTON tbb = { 0 }; + PWSTR MenuString = NULL; + tbb.fsState = TBSTATE_ENABLED; tbb.fsStyle = 0; @@ -961,24 +961,24 @@ if (!AllocAndGetMenuString(m_hmenu, i, &MenuString)) return E_OUTOFMEMORY; tbb.fsStyle |= BTNS_DROPDOWN; + tbb.iString = (INT_PTR) MenuString; + tbb.idCommand = info.wID; + + SMINFO sminfo; + if (info.wID >= 0 && SUCCEEDED(m_menuBand->CallCBWithId(info.wID, SMC_GETINFO, 0, (LPARAM) &sminfo))) + { + tbb.iBitmap = sminfo.iIcon; + } } else { - MenuString = L""; tbb.fsStyle |= BTNS_SEP; } - tbb.idCommand = info.wID; - tbb.iString = (INT_PTR) MenuString; - - SMINFO sminfo; - if (info.wID >= 0 && SUCCEEDED(m_menuBand->CallCBWithId(info.wID, SMC_GETINFO, 0, (LPARAM) &sminfo))) - { - tbb.iBitmap = sminfo.iIcon; - } - SendMessageW(m_hwnd, TB_ADDBUTTONS, 1, (LPARAM) (LPTBBUTTON) &tbb); - HeapFree(GetProcessHeap(), 0, MenuString); + + if (MenuString) + HeapFree(GetProcessHeap(), 0, MenuString); } return S_OK; Modified: branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] Sun Feb 16 21:53:21 2014 @@ -160,8 +160,6 @@ COM_INTERFACE_ENTRY_IID(IID_IBanneredBar, IBanneredBar) COM_INTERFACE_ENTRY_IID(IID_IInitializeObject, IInitializeObject) END_COM_MAP() - - HRESULT _CreateDeskBarWindow(); }; extern "C" @@ -456,40 +454,6 @@ { } -HRESULT CMenuDeskBar::_CreateDeskBarWindow() -{ - HRESULT hr; - HWND ownerWindow = NULL; - - if (m_Site) - { - CComPtr<IOleWindow> oleWindow; - - hr = m_Site->QueryInterface(IID_IOleWindow, reinterpret_cast<void **>(&oleWindow)); - if (FAILED(hr)) - return hr; - - hr = oleWindow->GetWindow(&ownerWindow); - if (FAILED(hr)) - return hr; - - if (!::IsWindow(ownerWindow)) - return E_FAIL; - } - - // FIXME - if (m_hWnd) - { - SetWindowLongPtr(m_hWnd, GWLP_HWNDPARENT, (LONG_PTR)ownerWindow); - } - else - { - Create(ownerWindow); - } - - return S_OK; -} - HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetWindow(HWND *lphwnd) { if (lphwnd == NULL) @@ -547,6 +511,11 @@ if (m_Site == NULL) return E_FAIL; + if (IsEqualGUID(guidService,SID_SMenuPopup)) + { + return this->QueryInterface(riid, ppvObject); + } + return IUnknown_QueryService(m_Site, guidService, riid, ppvObject); } @@ -589,7 +558,7 @@ if (m_hWnd == NULL) { - _CreateDeskBarWindow(); + Create(NULL); } hResult = punkClient->QueryInterface(IID_IUnknown, reinterpret_cast<void **>(&m_Client)); @@ -623,30 +592,9 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetSite(IUnknown *pUnkSite) { - HRESULT hr; - CComPtr<IOleWindow> oleWindow; - HWND ownerWindow = NULL; - - if (m_Site) - { - if (m_hWnd != NULL) - { - DestroyWindow(); - } - m_Site.Release(); - } - - if (pUnkSite == NULL) - { - return S_OK; - } - - // get window handle of parent - hr = pUnkSite->QueryInterface(IID_PPV_ARG(IUnknown, &m_Site)); - if (FAILED(hr)) - return hr; - - return _CreateDeskBarWindow(); + m_Site = pUnkSite; + + return S_OK; } HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetSite(REFIID riid, void **ppvSite) @@ -822,7 +770,7 @@ int cx = rc.right; int cy = rc.bottom; - this->SetWindowPos(NULL, x, y, cx, cy, SWP_SHOWWINDOW); + this->SetWindowPos(HWND_TOPMOST, x, y, cx, cy, SWP_SHOWWINDOW); // HACK: The bar needs to be notified of the size AFTER it is shown. // Quick & dirty way of getting it done.
10 years, 10 months
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
47
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Results per page:
10
25
50
100
200