shell32 patch 30

Martin Fuchs martin-fuchs at gmx.net
Sat Apr 3 02:28:26 CST 2004


Changelog:
get icons for shell link files


Index: folders.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/folders.c,v
retrieving revision 1.43
diff -u -p -d -r1.43 folders.c
--- folders.c	27 Mar 2004 01:42:22 -0000	1.43
+++ folders.c	3 Apr 2004 08:27:10 -0000
@@ -259,12 +259,35 @@ static HRESULT WINAPI IExtractIconW_fnGe
 
 	      found = TRUE;
 	    }
-
-	    if (!found)					/* default icon */
+	    else if (!strcasecmp(sTemp, "lnkfile"))
 	    {
-	      lstrcpynW(szIconFile, swShell32Name, cchMax);
-	      *piIndex = 0;
+	      /* extract icon from shell shortcut */
+	      IShellFolder* dsf;
+	      IShellLinkW* psl;
+
+	      if (SUCCEEDED(SHGetDesktopFolder(&dsf)))
+	      {
+		HRESULT hr = IShellFolder_GetUIObjectOf(dsf, NULL, 1, (LPCITEMIDLIST*)&This->pidl, &IID_IShellLinkW, NULL, (LPVOID*)&psl);
+
+		if (SUCCEEDED(hr))
+		{
+		  hr = IShellLinkW_GetIconLocation(psl, szIconFile, MAX_PATH, piIndex);
+
+		  if (SUCCEEDED(hr) && *szIconFile)
+		    found = TRUE;
+
+		  IShellLinkW_Release(psl);
+		}
+
+		IShellFolder_Release(dsf);
+	      }
 	    }
+	  }
+
+	  if (!found)					/* default icon */
+	  {
+	    lstrcpynW(szIconFile, swShell32Name, cchMax);
+	    *piIndex = 0;
 	  }
 	}
 





More information about the wine-patches mailing list