[ros-diffs] [janderwald] 34320: - 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

janderwald at svn.reactos.org janderwald at svn.reactos.org
Sun Jul 6 10:29:28 CEST 2008


Author: janderwald
Date: Sun Jul  6 03:29:28 2008
New Revision: 34320

URL: http://svn.reactos.org/svn/reactos?rev=34320&view=rev
Log:
- 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

Modified:
    trunk/reactos/dll/win32/shell32/pidl.c
    trunk/reactos/dll/win32/shell32/pidl.h
    trunk/reactos/dll/win32/shell32/she_ocmenu.c
    trunk/reactos/dll/win32/shell32/shelllink.c
    trunk/reactos/dll/win32/shell32/shv_item_cmenu.c

Modified: trunk/reactos/dll/win32/shell32/pidl.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/pidl.c?rev=34320&r1=34319&r2=34320&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/pidl.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/pidl.c [iso-8859-1] Sun Jul  6 03:29:28 2008
@@ -1626,6 +1626,18 @@
     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);

Modified: trunk/reactos/dll/win32/shell32/pidl.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/pidl.h?rev=34320&r1=34319&r2=34320&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/pidl.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/pidl.h [iso-8859-1] Sun Jul  6 03:29:28 2008
@@ -207,20 +207,20 @@
 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

Modified: trunk/reactos/dll/win32/shell32/she_ocmenu.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/she_ocmenu.c?rev=34320&r1=34319&r2=34320&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/she_ocmenu.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/she_ocmenu.c [iso-8859-1] Sun Jul  6 03:29:28 2008
@@ -1230,7 +1230,7 @@
         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");

Modified: trunk/reactos/dll/win32/shell32/shelllink.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shelllink.c?rev=34320&r1=34319&r2=34320&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/shelllink.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shelllink.c [iso-8859-1] Sun Jul  6 03:29:28 2008
@@ -163,7 +163,6 @@
     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 @@
                             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;
 
@@ -2485,6 +2483,11 @@
 
     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);
@@ -2497,18 +2500,6 @@
     if (!InsertMenuItemW( hmenu, indexMenu, TRUE, &mii ))
         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 @@
  * creates a shortcut property dialog
  */
 
-static HRESULT WINAPI
+HRESULT WINAPI
 ShellLink_ShowProperties( IShellLinkImpl *This )
 {
     PROPSHEETHEADERW pinfo;
@@ -2782,12 +2773,6 @@
 
     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) )
     {

Modified: trunk/reactos/dll/win32/shell32/shv_item_cmenu.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_item_cmenu.c?rev=34320&r1=34319&r2=34320&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/shv_item_cmenu.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shv_item_cmenu.c [iso-8859-1] Sun Jul  6 03:29:28 2008
@@ -304,6 +304,7 @@
 {
     UINT i;
     WCHAR buffer[111];
+    WCHAR szProgKey[20];
     char ebuf[10];
     HRESULT hr;
     HRESULT hResult;
@@ -322,8 +323,6 @@
                 NULL,
                 &bGroupPolicyActive,
                 &dwSize);
-    
-
 
     SH_EnumerateDynamicContextHandlerForKey(szAny, This, pDataObj, bGroupPolicyActive);
 
@@ -349,7 +348,15 @@
             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");



More information about the Ros-diffs mailing list