wine/dlls/shell32/classes.c

96 lines
1.8 KiB
C
Raw Normal View History

1998-11-22 18:26:23 +00:00
/*
* file type mapping
* (HKEY_CLASSES_ROOT - Stuff)
*
*
*/
#include <stdlib.h>
#include <string.h>
#include "debug.h"
#include "winerror.h"
#include "winreg.h"
1998-11-22 18:26:23 +00:00
#include "shlobj.h"
1998-11-22 18:26:23 +00:00
#include "shell32_main.h"
1998-12-18 14:52:08 +00:00
BOOL32 HCR_MapTypeToValue ( LPCSTR szExtension, LPSTR szFileType, DWORD len)
1998-11-22 18:26:23 +00:00
{ HKEY hkey;
TRACE(shell, "%s %p\n",szExtension, szFileType );
1998-11-22 18:26:23 +00:00
if (RegOpenKeyEx32A(HKEY_CLASSES_ROOT,szExtension,0,0x02000000,&hkey))
{ return FALSE;
}
if (RegQueryValue32A(hkey,NULL,szFileType,&len))
{ RegCloseKey(hkey);
return FALSE;
}
RegCloseKey(hkey);
TRACE(shell, "-- %s\n", szFileType );
return TRUE;
}
1998-12-14 17:33:00 +00:00
BOOL32 HCR_GetExecuteCommand ( LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD len )
{ HKEY hkey;
char sTemp[256];
TRACE(shell, "%s %s\n",szClass, szVerb );
sprintf(sTemp, "%s\\shell\\%s\\command",szClass, szVerb);
if (RegOpenKeyEx32A(HKEY_CLASSES_ROOT,sTemp,0,0x02000000,&hkey))
{ return FALSE;
}
if (RegQueryValue32A(hkey,NULL,szDest,&len))
{ RegCloseKey(hkey);
return FALSE;
}
RegCloseKey(hkey);
TRACE(shell, "-- %s\n", szDest );
return TRUE;
}
1998-12-14 17:33:00 +00:00
/***************************************************************************************
* 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;
}
1998-11-22 18:26:23 +00:00