3 * (HKEY_CLASSES_ROOT - Stuff)
9 #include "debugtools.h"
14 #include "shell32_main.h"
18 DEFAULT_DEBUG_CHANNEL(shell)
20 #define MAX_EXTENSION_LENGTH 20
22 BOOL HCR_MapTypeToValue ( LPCSTR szExtension, LPSTR szFileType, DWORD len, BOOL bPrependDot)
24 char szTemp[MAX_EXTENSION_LENGTH + 2];
26 TRACE("%s %p\n",szExtension, szFileType );
31 lstrcpynA(szTemp+((bPrependDot)?1:0), szExtension, MAX_EXTENSION_LENGTH);
33 if (RegOpenKeyExA(HKEY_CLASSES_ROOT,szTemp,0,0x02000000,&hkey))
37 if (RegQueryValueA(hkey,NULL,szFileType,&len))
44 TRACE("-- %s\n", szFileType );
48 BOOL HCR_GetExecuteCommand ( LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD len )
52 TRACE("%s %s\n",szClass, szVerb );
54 sprintf(sTemp, "%s\\shell\\%s\\command",szClass, szVerb);
56 if (RegOpenKeyExA(HKEY_CLASSES_ROOT,sTemp,0,0x02000000,&hkey))
60 if (RegQueryValueA(hkey,NULL,szDest,&len))
66 TRACE("-- %s\n", szDest );
71 /***************************************************************************************
72 * HCR_GetDefaultIcon [internal]
74 * Gets the icon for a filetype
76 BOOL HCR_GetDefaultIcon (LPCSTR szClass, LPSTR szDest, DWORD len, LPDWORD dwNr)
81 TRACE("%s\n",szClass );
83 sprintf(sTemp, "%s\\DefaultIcon",szClass);
85 if (RegOpenKeyExA(HKEY_CLASSES_ROOT,sTemp,0,0x02000000,&hkey))
89 if (RegQueryValueA(hkey,NULL,szDest,&len))
96 if (ParseFieldA (szDest, 2, sNum, 5))
100 ParseFieldA (szDest, 1, szDest, len);
102 TRACE("-- %s %li\n", szDest, *dwNr );
107 /***************************************************************************************
108 * HCR_GetClassName [internal]
110 * Gets the name of a registred class
112 BOOL HCR_GetClassName (REFIID riid, LPSTR szDest, DWORD len)
118 strcpy(xriid,"CLSID\\");
119 WINE_StringFromCLSID(riid,&xriid[strlen(xriid)]);
121 TRACE("%s\n",xriid );
123 if (!RegOpenKeyExA(HKEY_CLASSES_ROOT,xriid,0,KEY_READ,&hkey))
125 if (!RegQueryValueExA(hkey,"",0,NULL,szDest,&len))
132 if (!ret || !szDest[0])
134 if(IsEqualIID(riid, &CLSID_ShellDesktop))
136 LoadStringA(shell32_hInstance, IDS_DESKTOP, szDest, buflen);
139 else if (IsEqualIID(riid, &CLSID_MyComputer))
141 LoadStringA(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen);
146 TRACE("-- %s\n", szDest);
151 /***************************************************************************************
152 * HCR_GetFolderAttributes [internal]
154 * gets the folder attributes of a class
157 * verify the defaultvalue for *szDest
159 BOOL HCR_GetFolderAttributes (REFIID riid, LPDWORD szDest)
165 strcpy(xriid,"CLSID\\");
166 WINE_StringFromCLSID(riid,&xriid[strlen(xriid)]);
167 TRACE("%s\n",xriid );
169 if (!szDest) return FALSE;
170 *szDest = SFGAO_FOLDER|SFGAO_FILESYSTEM;
172 strcat (xriid, "\\ShellFolder");
174 if (RegOpenKeyExA(HKEY_CLASSES_ROOT,xriid,0,KEY_READ,&hkey))
179 if (RegQueryValueExA(hkey,"Attributes",0,NULL,(LPBYTE)&attributes,&len))
187 TRACE("-- 0x%08lx\n", attributes);
189 *szDest = attributes;