- implement _ILIsNetHood

- don't show OpenWith dialog on network neighbourhoud shell folder
- use translatable "open" verb for shelllink's context menu
- deactivate shelllink property dialog, it should be implemented using IShellPropSheetExt interface
- enumerate context menu handlers also in the progid key
- shortcut items now show again the "open" item

svn path=/trunk/; revision=34320
This commit is contained in:
Johannes Anderwald 2008-07-06 08:29:28 +00:00
parent 718de23271
commit ad14fa367a
5 changed files with 33 additions and 29 deletions

View file

@ -1626,6 +1626,18 @@ BOOL _ILIsControlPanel(LPCITEMIDLIST pidl)
return FALSE;
}
BOOL _ILIsNetHood(LPCITEMIDLIST pidl)
{
REFIID iid = _ILGetGUIDPointer(pidl);
TRACE("(%p)\n",pidl);
if (iid)
return IsEqualIID(iid, &CLSID_NetworkPlaces);
return FALSE;
}
LPITEMIDLIST _ILCreateNetHood(void)
{
return _ILCreateGuid(PT_GUID, &CLSID_NetworkPlaces);

View file

@ -207,20 +207,20 @@ BOOL _ILIsMyComputer (LPCITEMIDLIST pidl);
BOOL _ILIsMyDocuments (LPCITEMIDLIST pidl);
BOOL _ILIsControlPanel (LPCITEMIDLIST pidl);
BOOL _ILIsBitBucket (LPCITEMIDLIST pidl);
BOOL _ILIsNetHood (LPCITEMIDLIST pidl);
BOOL _ILIsDrive (LPCITEMIDLIST pidl);
BOOL _ILIsFolder (LPCITEMIDLIST pidl);
BOOL _ILIsValue (LPCITEMIDLIST pidl);
BOOL _ILIsSpecialFolder (LPCITEMIDLIST pidl);
BOOL _ILIsPidlSimple (LPCITEMIDLIST pidl);
BOOL _ILIsCPanelStruct (LPCITEMIDLIST pidl);
static inline
BOOL _ILIsEqualSimple (LPCITEMIDLIST pidlA, LPCITEMIDLIST pidlB)
static BOOL __inline _ILIsEqualSimple (LPCITEMIDLIST pidlA, LPCITEMIDLIST pidlB)
{
return (pidlA->mkid.cb > 0 && !memcmp(pidlA, pidlB, pidlA->mkid.cb)) ||
(!pidlA->mkid.cb && !pidlB->mkid.cb);
}
static inline
BOOL _ILIsEmpty (LPCITEMIDLIST pidl) { return _ILIsDesktop(pidl); }
static
BOOL __inline _ILIsEmpty (LPCITEMIDLIST pidl) { return _ILIsDesktop(pidl); }
/*
* simple pidls

View file

@ -1230,7 +1230,7 @@ SHEOW_LoadOpenWithItems(SHEOWImpl *This, IDataObject *pdtobj)
ERR("no mem\n");
return E_OUTOFMEMORY;
}
if (_ILIsDesktop(pidl_child) || _ILIsMyDocuments(pidl_child) || _ILIsControlPanel(pidl_child) ||
if (_ILIsDesktop(pidl_child) || _ILIsMyDocuments(pidl_child) || _ILIsControlPanel(pidl_child) || _ILIsNetHood(pidl_child) ||
_ILIsBitBucket(pidl_child) || _ILIsDrive(pidl_child) || _ILIsCPanelStruct(pidl_child) || _ILIsFolder(pidl_child))
{
TRACE("pidl is a folder\n");

View file

@ -163,7 +163,6 @@ typedef struct
BOOL bRunAs;
BOOL bDirty;
INT iIdOpen; /* id of the "Open" entry in the context menu */
INT iIdProperties; /* id of the "Properties" entry in the context menu */
IUnknown *site;
} IShellLinkImpl;
@ -2475,8 +2474,7 @@ ShellLink_QueryContextMenu( IContextMenu* iface, HMENU hmenu, UINT indexMenu,
UINT idCmdFirst, UINT idCmdLast, UINT uFlags )
{
IShellLinkImpl *This = impl_from_IContextMenu(iface);
static WCHAR szOpen[] = { 'O','p','e','n',0 };
static WCHAR szProperties[] = { 'P','r','o','p','e','r','t','i','e','s',0 };
WCHAR szOpen[20];
MENUITEMINFOW mii;
int id = 1;
@ -2486,6 +2484,11 @@ ShellLink_QueryContextMenu( IContextMenu* iface, HMENU hmenu, UINT indexMenu,
if ( !hmenu )
return E_INVALIDARG;
if (!LoadStringW(shell32_hInstance, IDS_OPEN_VERB, szOpen, sizeof(szOpen)/sizeof(WCHAR)))
szOpen[0] = L'\0';
else
szOpen[(sizeof(szOpen)/sizeof(WCHAR))-1] = L'\0';
memset( &mii, 0, sizeof(mii) );
mii.cbSize = sizeof (mii);
mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
@ -2498,18 +2501,6 @@ ShellLink_QueryContextMenu( IContextMenu* iface, HMENU hmenu, UINT indexMenu,
return E_FAIL;
This->iIdOpen = 0;
mii.fState = MFS_ENABLED;
mii.dwTypeData = (LPWSTR)szProperties;
mii.cch = strlenW( mii.dwTypeData );
mii.wID = idCmdFirst + id++;
if (!InsertMenuItemW( hmenu, idCmdLast, TRUE, &mii ))
{
TRACE("ShellLink_QueryContextMenu failed to insert item properties");
return E_FAIL;
}
This->iIdProperties = 1;
id++;
return MAKE_HRESULT( SEVERITY_SUCCESS, 0, id );
}
@ -2723,7 +2714,7 @@ SH_ShellLinkDlgProc(
* creates a shortcut property dialog
*/
static HRESULT WINAPI
HRESULT WINAPI
ShellLink_ShowProperties( IShellLinkImpl *This )
{
PROPSHEETHEADERW pinfo;
@ -2783,12 +2774,6 @@ ShellLink_InvokeCommand( IContextMenu* iface, LPCMINVOKECOMMANDINFO lpici )
if ( lpici->cbSize < sizeof (CMINVOKECOMMANDINFO) )
return E_INVALIDARG;
if ( lpici->lpVerb == MAKEINTRESOURCEA(This->iIdProperties))
{
ShellLink_ShowProperties(This);
return S_OK;
}
if ( lpici->lpVerb != MAKEINTRESOURCEA(This->iIdOpen) )
{
ERR("Unknown id %d != %d\n", (INT)lpici->lpVerb, This->iIdOpen );

View file

@ -304,6 +304,7 @@ SH_LoadContextMenuHandlers(ItemCmImpl *This, IDataObject * pDataObj, HMENU hMenu
{
UINT i;
WCHAR buffer[111];
WCHAR szProgKey[20];
char ebuf[10];
HRESULT hr;
HRESULT hResult;
@ -322,8 +323,6 @@ SH_LoadContextMenuHandlers(ItemCmImpl *This, IDataObject * pDataObj, HMENU hMenu
NULL,
&bGroupPolicyActive,
&dwSize);
SH_EnumerateDynamicContextHandlerForKey(szAny, This, pDataObj, bGroupPolicyActive);
@ -349,7 +348,15 @@ SH_LoadContextMenuHandlers(ItemCmImpl *This, IDataObject * pDataObj, HMENU hMenu
ebuf[0] = L'.';
buffer[0] = L'\0';
if (MultiByteToWideChar(CP_ACP, 0, ebuf, -1, buffer, 111))
{
SH_EnumerateDynamicContextHandlerForKey(buffer, This, pDataObj, bGroupPolicyActive);
dwSize = sizeof(szProgKey);
if (RegGetValueW(HKEY_CLASSES_ROOT, buffer, NULL, RRF_RT_REG_SZ, NULL, szProgKey, &dwSize) == ERROR_SUCCESS)
{
szProgKey[(sizeof(szProgKey)/sizeof(WCHAR))-1] = L'\0';
SH_EnumerateDynamicContextHandlerForKey(szProgKey, This, pDataObj, bGroupPolicyActive);
}
}
}
}
TRACE("-- done loading\n");