[shell32]

- Do not call OnDefaultCommand when there is no selected item in the shell view

svn path=/trunk/; revision=59580
This commit is contained in:
Giannis Adamopoulos 2013-07-25 12:57:56 +00:00
parent 99c37102d1
commit b5c485fb74

View file

@ -1102,6 +1102,10 @@ HRESULT CDefView::OpenSelectedItems()
UINT uCommand;
HRESULT hResult;
cidl = ListView_GetSelectedCount(hWndList);
if (cidl == 0)
return S_OK;
hResult = OnDefaultCommand();
if (hResult == S_OK)
return hResult;
@ -1175,7 +1179,7 @@ LRESULT CDefView::OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &b
if (!hMenu)
return E_FAIL;
GetSelections();
cidl = ListView_GetSelectedCount(hWndList);
hResult = GetItemObject( cidl ? SVGIO_SELECTION : SVGIO_BACKGROUND, IID_IContextMenu, (LPVOID *)&pCM);
if (FAILED( hResult))