< prev index next >

src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp

Print this page

        

@@ -918,11 +918,11 @@
  * Method:    extractIcon
  * Signature: (JJZZ)J
  */
 JNIEXPORT jlong JNICALL Java_sun_awt_shell_Win32ShellFolder2_extractIcon
     (JNIEnv* env, jclass cls, jlong pIShellFolderL, jlong relativePIDL,
-                                jboolean getLargeIcon, jboolean getDefaultIcon)
+                                jint size, jboolean getDefaultIcon)
 {
     IShellFolder* pIShellFolder = (IShellFolder*)pIShellFolderL;
     LPITEMIDLIST pidl = (LPITEMIDLIST)relativePIDL;
     if (pIShellFolder == NULL || pidl == NULL) {
         return 0;

@@ -939,20 +939,11 @@
         INT index;
         UINT flags;
         UINT uFlags = getDefaultIcon ? GIL_DEFAULTICON : GIL_FORSHELL | GIL_ASYNC;
         hres = pIcon->GetIconLocation(uFlags, szBuf, MAX_PATH, &index, &flags);
         if (SUCCEEDED(hres)) {
-            HICON hIconLarge;
-            hres = pIcon->Extract(szBuf, index, &hIconLarge, &hIcon, (16 << 16) + 32);
-            if (SUCCEEDED(hres)) {
-                if (getLargeIcon) {
-                    fn_DestroyIcon((HICON)hIcon);
-                    hIcon = hIconLarge;
-                } else {
-                    fn_DestroyIcon((HICON)hIconLarge);
-                }
-            }
+            hres = pIcon->Extract(szBuf, index, &hIcon, 0, size);
         } else if (hres == E_PENDING) {
             pIcon->Release();
             return E_PENDING;
         }
         pIcon->Release();
< prev index next >