Class->hModule = lpwcx->hInstance;
Class->hIcon = lpwcx->hIcon;
Class->hIconSm = lpwcx->hIconSm;
- Class->hIconSmIntern = lpwcx->hIcon && !lpwcx->hIconSm ?
- co_IntCopyImage( lpwcx->hIcon, IMAGE_ICON,
+ //// Sure W2k3 does not do this..... wine test inconclusive.
+ if (lpwcx->hIcon && !lpwcx->hIconSm)
+ {
+ Class->hIconSmIntern = co_IntCopyImage( lpwcx->hIcon, IMAGE_ICON,
UserGetSystemMetrics( SM_CXSMICON ),
- UserGetSystemMetrics( SM_CYSMICON ), 0 ) : NULL;
+ UserGetSystemMetrics( SM_CYSMICON ), 0 );
+ ERR("IntCreateClass hIconSmIntern %p\n",Class->hIconSmIntern);
+ Class->CSF_flags |= CSF_CACHEDSMICON;
+ }
+ ////
Class->hCursor = lpwcx->hCursor;
Class->hbrBackground = lpwcx->hbrBackground;
/* FIXME: Get handle from pointer to ICON object */
Ret = (ULONG_PTR)Class->hIconSm;
if (Class->hIconSm == (HANDLE)NewLong) break;
-/* if (Ret && !NewLong)
- {
- hIconSmIntern = Class->hIconSmIntern = Class->hIcon ? co_IntCopyImage( Class->hIcon, IMAGE_ICON,
- UserGetSystemMetrics( SM_CXSMICON ),
- UserGetSystemMetrics( SM_CYSMICON ), 0 ) : NULL;
- Class->CSF_flags |= CSF_CACHEDSMICON;
- }
- else if (!Ret && NewLong && Class->hIconSmIntern)
- {
- IntClassDestroyIcon(Class->hIconSmIntern);
- Class->CSF_flags &= ~CSF_CACHEDSMICON;
- Class->hIconSmIntern = NULL;
- }
-*/
if (Class->CSF_flags & CSF_CACHEDSMICON)
{
- if (Class->hIconSmIntern) IntClassDestroyIcon(Class->hIconSmIntern);
+ if (Class->hIconSmIntern)
+ {
+ IntClassDestroyIcon(Class->hIconSmIntern);
+ Class->hIconSmIntern = NULL;
+ }
Class->CSF_flags &= ~CSF_CACHEDSMICON;
- Class->hIconSmIntern = NULL;
- Ret = 0;
}
if (Class->hIcon && !Class->hIconSmIntern)
{
hIconSmIntern = Class->hIconSmIntern = co_IntCopyImage( Class->hIcon, IMAGE_ICON,
UserGetSystemMetrics( SM_CXSMICON ),
UserGetSystemMetrics( SM_CYSMICON ), 0 );
+
if (hIconSmIntern) Class->CSF_flags |= CSF_CACHEDSMICON;
+ //// FIXME: Very hacky here but it passes the tests....
+ //// We should not kill a users handle!!!
+ if (Class->hIconSm) IntClassDestroyIcon(Class->hIconSm); // Fixes 1013
+ Ret = 0; // Fixes 1009
}
Class->hIconSm = (HANDLE)NewLong;