mirror of
https://github.com/reactos/reactos.git
synced 2024-11-27 13:33:32 +08:00
[SHELL32] CDefView: Respect item attributes
This commit is contained in:
parent
91e63ee0b5
commit
d039653959
@ -1587,6 +1587,26 @@ LRESULT CDefView::OnExplorerCommand(UINT uCommand, BOOL bUseSelection)
|
||||
if (FAILED_UNEXPECTEDLY( hResult))
|
||||
goto cleanup;
|
||||
|
||||
if (bUseSelection)
|
||||
{
|
||||
// FIXME: we should cache this....
|
||||
SFGAOF rfg = SFGAO_BROWSABLE | SFGAO_CANCOPY | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANDELETE | SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_FILESYSTEM | SFGAO_FOLDER;
|
||||
hResult = m_pSFParent->GetAttributesOf(m_cidl, m_apidl, &rfg);
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return 0;
|
||||
|
||||
if (!(rfg & SFGAO_CANMOVE) && uCommand == FCIDM_SHVIEW_CUT)
|
||||
return 0;
|
||||
if (!(rfg & SFGAO_CANCOPY) && uCommand == FCIDM_SHVIEW_COPY)
|
||||
return 0;
|
||||
if (!(rfg & SFGAO_CANDELETE) && uCommand == FCIDM_SHVIEW_DELETE)
|
||||
return 0;
|
||||
if (!(rfg & SFGAO_CANRENAME) && uCommand == FCIDM_SHVIEW_RENAME)
|
||||
return 0;
|
||||
if (!(rfg & SFGAO_HASPROPSHEET) && uCommand == FCIDM_SHVIEW_PROPERTIES)
|
||||
return 0;
|
||||
}
|
||||
|
||||
InvokeContextMenuCommand(uCommand);
|
||||
|
||||
cleanup:
|
||||
@ -1819,6 +1839,9 @@ LRESULT CDefView::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHand
|
||||
case FCIDM_SHVIEW_PROPERTIES:
|
||||
case FCIDM_SHVIEW_COPYTO:
|
||||
case FCIDM_SHVIEW_MOVETO:
|
||||
if (SHRestricted(REST_NOVIEWCONTEXTMENU))
|
||||
return 0;
|
||||
|
||||
return OnExplorerCommand(dwCmdID, TRUE);
|
||||
|
||||
case FCIDM_SHVIEW_INSERT:
|
||||
|
Loading…
Reference in New Issue
Block a user