New HCR_GetDefaultIcon (internal).

This commit is contained in:
Juergen Schmied 1998-12-14 17:33:00 +00:00 committed by Alexandre Julliard
parent 35693719af
commit 01fc2baa58
1 changed files with 38 additions and 2 deletions

View File

@ -14,7 +14,7 @@
#include "shell32_main.h"
BOOL32 WINAPI HCR_MapTypeToValue ( LPSTR szExtension, LPSTR szFileType, DWORD len)
BOOL32 HCR_MapTypeToValue ( LPSTR szExtension, LPSTR szFileType, DWORD len)
{ HKEY hkey;
TRACE(shell, "%s %p\n",szExtension, szFileType );
@ -34,7 +34,7 @@ BOOL32 WINAPI HCR_MapTypeToValue ( LPSTR szExtension, LPSTR szFileType, DWORD le
return TRUE;
}
BOOL32 WINAPI HCR_GetExecuteCommand ( LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD len )
BOOL32 HCR_GetExecuteCommand ( LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD len )
{ HKEY hkey;
char sTemp[256];
@ -57,4 +57,40 @@ BOOL32 WINAPI HCR_GetExecuteCommand ( LPCSTR szClass, LPCSTR szVerb, LPSTR szDes
return TRUE;
}
/***************************************************************************************
* HCR_GetDefaultIcon [internal]
*
* Gets the icon for a filetype
*/
BOOL32 HCR_GetDefaultIcon (LPCSTR szClass, LPSTR szDest, DWORD len, LPDWORD dwNr)
{ HKEY hkey;
char sTemp[256];
char sNum[5];
TRACE(shell, "%s\n",szClass );
sprintf(sTemp, "%s\\DefaultIcon",szClass);
if (RegOpenKeyEx32A(HKEY_CLASSES_ROOT,sTemp,0,0x02000000,&hkey))
{ return FALSE;
}
if (RegQueryValue32A(hkey,NULL,szDest,&len))
{ RegCloseKey(hkey);
return FALSE;
}
RegCloseKey(hkey);
if (ParseField32A (szDest, 2, sNum, 5))
{ *dwNr=atoi(sNum);
}
ParseField32A (szDest, 1, szDest, len);
TRACE(shell, "-- %s %li\n", szDest, *dwNr );
return TRUE;
}