Author: dquintana Date: Tue Mar 11 17:40:18 2014 New Revision: 62475
URL: http://svn.reactos.org/svn/reactos?rev=62475&view=rev Log: [RSHELL] * Workaround for the exec issue. Ros currently seems to send a bogus WM_ACTIVATE message when clicking while the window is already active. Proper fix may come later if I can figure out why this happens.
CORE-7586
Modified: branches/shell-experiments/base/shell/explorer-new/traywnd.c branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp branches/shell-experiments/base/shell/rshell/CStartMenu.cpp
Modified: branches/shell-experiments/base/shell/explorer-new/traywnd.c URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/exp... ============================================================================== --- branches/shell-experiments/base/shell/explorer-new/traywnd.c [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/explorer-new/traywnd.c [iso-8859-1] Tue Mar 11 17:40:18 2014 @@ -2610,7 +2610,7 @@ }
if (This->TrayBandSite == NULL || - !SUCCEEDED(ITrayBandSite_ProcessMessage(This->TrayBandSite, + FAILED(ITrayBandSite_ProcessMessage(This->TrayBandSite, hwnd, uMsg, wParam,
Modified: branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] Tue Mar 11 17:40:18 2014 @@ -491,7 +491,7 @@ if (FAILED_UNEXPECTEDLY(hr)) return hr;
- SetWindowPos(m_hWnd, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER); + SetWindowPos(NULL, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE);
return UIActivateIO(FALSE, NULL); } @@ -609,8 +609,13 @@
LRESULT CMenuDeskBar::_OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) { - if (wParam != 0) + DbgPrint("BaseBar %08p (de)activated (%08x, %08x).\n", m_hWnd, wParam, lParam); + + // BUG in ReactOS: WM_ACTIVATE/WA_INACTIVE makes no sense with lParam==hWnd + if (LOWORD(wParam) != 0 || reinterpret_cast<HWND>(lParam) == m_hWnd) + { return 0; + }
// HACK! I just want it to work !!! CComPtr<IDeskBar> db;
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Tue Mar 11 17:40:18 2014 @@ -622,7 +622,10 @@ PopupItem(wParam); return S_FALSE; } - return m_menuBand->_MenuItemHotTrack(MPOS_EXECUTE); + HRESULT hr = m_menuBand->_MenuItemHotTrack(MPOS_EXECUTE); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + return S_OK; // filter out a possible S_FALSE from here. }
HRESULT CMenuToolbarBase::ChangeHotItem(DWORD dwSelectType) @@ -938,7 +941,10 @@
// in case the clicked item has a submenu, we do not need to execute the item if (hr == S_FALSE) - return hr; + { + DbgPrint("CMenuToolbarBase::OnCommand told us to cancel.\n"); + return hr; + }
return m_menuBand->_CallCBWithItemId(wParam, SMC_EXEC, 0, 0); } @@ -1102,7 +1108,10 @@
// in case the clicked item has a submenu, we do not need to execute the item if (hr == S_FALSE) - return hr; + { + DbgPrint("CMenuToolbarBase::OnCommand told us to cancel.\n"); + return hr; + }
DWORD_PTR data; GetDataFromId(wParam, NULL, &data);
Modified: branches/shell-experiments/base/shell/rshell/CStartMenu.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] Tue Mar 11 17:40:18 2014 @@ -267,8 +267,10 @@ case SMC_GETOBJECT: return OnGetObject(psmd, *reinterpret_cast<IID *>(wParam), reinterpret_cast<void **>(lParam)); case SMC_EXEC: + DbgPrint("SMC_EXEC\n"); return OnExec(psmd); case SMC_SFEXEC: + DbgPrint("SMC_SFEXEC\n"); m_pTrayPriv->Execute(psmd->psf, psmd->pidlItem); break; }