@@ -153,7 +153,7 @@ std::string GuidToInterfaceName(GUID guid)
153153bool isFirstApplicationRun (const std::string & name, const std::string & version)
154154{
155155 std::string key = ra::strings::Format (" HKEY_CURRENT_USER\\ Software\\ %s\\ %s" , name.c_str (), version.c_str ());
156- if (!win32_registry::createKey (key.c_str (), NULL ))
156+ if (!win32_registry::CreateKey (key.c_str (), NULL ))
157157 {
158158 // unable to get to the application's key.
159159 // assume it is not the first run.
@@ -165,13 +165,13 @@ bool isFirstApplicationRun(const std::string & name, const std::string & version
165165 // try to read the value
166166 win32_registry::MemoryBuffer value;
167167 win32_registry::REGISTRY_TYPE value_type;
168- if (!win32_registry::getValue (key.c_str (), FIRST_RUN_VALUE_NAME, value_type, value))
168+ if (!win32_registry::GetValue (key.c_str (), FIRST_RUN_VALUE_NAME, value_type, value))
169169 {
170170 // the registry value is not found.
171171 // assume the application is run for the first time.
172172
173173 // update the flag to "false" for the next call
174- win32_registry::setValue (key.c_str (), FIRST_RUN_VALUE_NAME, " false" ); // don't look at the write result
174+ win32_registry::SetValue (key.c_str (), FIRST_RUN_VALUE_NAME, " false" ); // don't look at the write result
175175
176176 return true ;
177177 }
@@ -181,7 +181,7 @@ bool isFirstApplicationRun(const std::string & name, const std::string & version
181181 if (first_run)
182182 {
183183 // update the flag to "false"
184- win32_registry::setValue (key.c_str (), FIRST_RUN_VALUE_NAME, " false" ); // don't look at the write result
184+ win32_registry::SetValue (key.c_str (), FIRST_RUN_VALUE_NAME, " false" ); // don't look at the write result
185185 }
186186
187187 return first_run;
@@ -329,7 +329,7 @@ void CContextMenu::BuildMenuTree(HMENU hMenu, shellanything::Menu * menu, UINT &
329329
330330 // ask the cache for an existing icon.
331331 // this will identify the icon in the cache as "used" or "active".
332- HBITMAP hBitmap = m_BitmapCache.find_handle (icon_filename, icon_index);
332+ HBITMAP hBitmap = m_BitmapCache.FindHandle (icon_filename, icon_index);
333333
334334 // if nothing in cache, create a new one
335335 if (hBitmap == shellanything::BitmapCache::INVALID_BITMAP_HANDLE)
@@ -357,7 +357,7 @@ void CContextMenu::BuildMenuTree(HMENU hMenu, shellanything::Menu * menu, UINT &
357357 DestroyIcon (hIconSmall);
358358
359359 // add the bitmap to the cache for future use
360- m_BitmapCache.add_handle ( icon_filename.c_str (), icon_index, hBitmap );
360+ m_BitmapCache.AddHandle ( icon_filename.c_str (), icon_index, hBitmap );
361361 }
362362 }
363363
@@ -407,7 +407,7 @@ void CContextMenu::BuildMenuTree(HMENU hMenu)
407407 // https://www.codeproject.com/Questions/1228261/Windows-shell-extension
408408 //
409409 // To prevent running out of bitmap ressource we use the shellanything::BitmapCache class.
410- // Each bitmap is identified as 'used' in CContextMenu::BuildMenuTree() with 'm_BitmapCache.find_handle ()'.
410+ // Each bitmap is identified as 'used' in CContextMenu::BuildMenuTree() with 'm_BitmapCache.FindHandle ()'.
411411 // Every 5 times the shell extension popup is displayed, we look for 'unused' bitmap and delete them.
412412 //
413413
@@ -416,10 +416,10 @@ void CContextMenu::BuildMenuTree(HMENU hMenu)
416416 if (m_BuildMenuTreeCount > 0 && (m_BuildMenuTreeCount % 5 ) == 0 )
417417 {
418418 // every 10 calls, refresh the cache
419- m_BitmapCache.destroy_old_handles ();
419+ m_BitmapCache.DestroyOldHandles ();
420420
421421 // reset counters
422- m_BitmapCache.reset_counters ();
422+ m_BitmapCache.ResetCounters ();
423423 }
424424
425425 // browse through all shellanything menus and build the win32 popup menus
@@ -1101,104 +1101,104 @@ STDAPI DllRegisterServer(void)
11011101 // Register version 1 of our class
11021102 {
11031103 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ %s" , class_name_version1);
1104- if (!win32_registry::createKey (key.c_str (), ShellExtensionDescription))
1104+ if (!win32_registry::CreateKey (key.c_str (), ShellExtensionDescription))
11051105 return E_ACCESSDENIED;
11061106 }
11071107 {
11081108 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ %s.1\\ CLSID" , ShellExtensionClassName);
1109- if (!win32_registry::createKey (key.c_str (), guid_str))
1109+ if (!win32_registry::CreateKey (key.c_str (), guid_str))
11101110 return E_ACCESSDENIED;
11111111 }
11121112
11131113 // Register current version of our class
11141114 {
11151115 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ %s" , ShellExtensionClassName);
1116- if (!win32_registry::createKey (key.c_str (), ShellExtensionDescription))
1116+ if (!win32_registry::CreateKey (key.c_str (), ShellExtensionDescription))
11171117 return E_ACCESSDENIED;
11181118 }
11191119 {
11201120 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ %s\\ CLSID" , ShellExtensionClassName);
1121- if (!win32_registry::createKey (key.c_str (), guid_str))
1121+ if (!win32_registry::CreateKey (key.c_str (), guid_str))
11221122 return E_ACCESSDENIED;
11231123 }
11241124 {
11251125 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ %s\\ CurVer" , ShellExtensionClassName);
1126- if (!win32_registry::createKey (key.c_str (), class_name_version1.c_str ()))
1126+ if (!win32_registry::CreateKey (key.c_str (), class_name_version1.c_str ()))
11271127 return E_ACCESSDENIED;
11281128 }
11291129
11301130 // Add the CLSID of this DLL to the registry
11311131 {
11321132 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ CLSID\\ %s" , guid_str);
1133- if (!win32_registry::createKey (key.c_str (), ShellExtensionDescription))
1133+ if (!win32_registry::CreateKey (key.c_str (), ShellExtensionDescription))
11341134 return E_ACCESSDENIED;
11351135 }
11361136
11371137 // Define the path and parameters of our DLL:
11381138 {
11391139 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ CLSID\\ %s\\ ProgID" , guid_str);
1140- if (!win32_registry::createKey (key.c_str (), class_name_version1.c_str ()))
1140+ if (!win32_registry::CreateKey (key.c_str (), class_name_version1.c_str ()))
11411141 return E_ACCESSDENIED;
11421142 }
11431143 {
11441144 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ CLSID\\ %s\\ VersionIndependentProgID" , guid_str);
1145- if (!win32_registry::createKey (key.c_str (), ShellExtensionClassName))
1145+ if (!win32_registry::CreateKey (key.c_str (), ShellExtensionClassName))
11461146 return E_ACCESSDENIED;
11471147 }
11481148 {
11491149 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ CLSID\\ %s\\ Programmable" , guid_str);
1150- if (!win32_registry::createKey (key.c_str ()))
1150+ if (!win32_registry::CreateKey (key.c_str ()))
11511151 return E_ACCESSDENIED;
11521152 }
11531153 {
11541154 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ CLSID\\ %s\\ InprocServer32" , guid_str);
1155- if (!win32_registry::createKey (key.c_str (), module_path.c_str () ))
1155+ if (!win32_registry::CreateKey (key.c_str (), module_path.c_str () ))
11561156 return E_ACCESSDENIED;
1157- if (!win32_registry::setValue (key.c_str (), " ThreadingModel" , " Apartment" ))
1157+ if (!win32_registry::SetValue (key.c_str (), " ThreadingModel" , " Apartment" ))
11581158 return E_ACCESSDENIED;
11591159 }
11601160
11611161 // Register the shell extension for all the file types
11621162 {
11631163 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ *\\ shellex\\ ContextMenuHandlers\\ %s" , ShellExtensionClassName);
1164- if (!win32_registry::createKey (key.c_str (), guid_str))
1164+ if (!win32_registry::CreateKey (key.c_str (), guid_str))
11651165 return E_ACCESSDENIED;
11661166 }
11671167
11681168 // Register the shell extension for directories
11691169 {
11701170 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ Directory\\ shellex\\ ContextMenuHandlers\\ %s" , ShellExtensionClassName);
1171- if (!win32_registry::createKey (key.c_str (), guid_str))
1171+ if (!win32_registry::CreateKey (key.c_str (), guid_str))
11721172 return E_ACCESSDENIED;
11731173 }
11741174
11751175 // Register the shell extension for folders
11761176 {
11771177 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ Folder\\ shellex\\ ContextMenuHandlers\\ %s" , ShellExtensionClassName);
1178- if (!win32_registry::createKey (key.c_str (), guid_str))
1178+ if (!win32_registry::CreateKey (key.c_str (), guid_str))
11791179 return E_ACCESSDENIED;
11801180 }
11811181
11821182 // Register the shell extension for the desktop or the file explorer's background
11831183 {
11841184 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ Directory\\ Background\\ ShellEx\\ ContextMenuHandlers\\ %s" , ShellExtensionClassName);
1185- if (!win32_registry::createKey (key.c_str (), guid_str))
1185+ if (!win32_registry::CreateKey (key.c_str (), guid_str))
11861186 return E_ACCESSDENIED;
11871187 }
11881188
11891189 // Register the shell extension for drives
11901190 {
11911191 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ Drive\\ ShellEx\\ ContextMenuHandlers\\ %s" , ShellExtensionClassName);
1192- if (!win32_registry::createKey (key.c_str (), guid_str))
1192+ if (!win32_registry::CreateKey (key.c_str (), guid_str))
11931193 return E_ACCESSDENIED;
11941194 }
11951195
11961196 // Register the shell extension to the system's approved Shell Extensions
11971197 {
11981198 std::string key = " HKEY_LOCAL_MACHINE\\ SOFTWARE\\ Microsoft\\ Windows\\ CurrentVersion\\ Shell Extensions\\ Approved" ;
1199- if (!win32_registry::createKey (key.c_str ()))
1199+ if (!win32_registry::CreateKey (key.c_str ()))
12001200 return E_ACCESSDENIED;
1201- if (!win32_registry::setValue (key.c_str (), guid_str, ShellExtensionDescription))
1201+ if (!win32_registry::SetValue (key.c_str (), guid_str, ShellExtensionDescription))
12021202 return E_ACCESSDENIED;
12031203 }
12041204
@@ -1223,61 +1223,61 @@ STDAPI DllUnregisterServer(void)
12231223 // Unregister the shell extension from the system's approved Shell Extensions
12241224 {
12251225 std::string key = " HKEY_LOCAL_MACHINE\\ SOFTWARE\\ Microsoft\\ Windows\\ CurrentVersion\\ Shell Extensions\\ Approved" ;
1226- if (!win32_registry::deleteValue (key.c_str (), guid_str))
1226+ if (!win32_registry::DeleteValue (key.c_str (), guid_str))
12271227 return E_ACCESSDENIED;
12281228 }
12291229
12301230 // Unregister the shell extension for drives
12311231 {
12321232 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ Drive\\ shellex\\ ContextMenuHandlers\\ %s" , ShellExtensionClassName);
1233- if (!win32_registry::deleteKey (key.c_str ()))
1233+ if (!win32_registry::DeleteKey (key.c_str ()))
12341234 return E_ACCESSDENIED;
12351235 }
12361236
12371237 // Unregister the shell extension for the desktop or the file explorer's background
12381238 {
12391239 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ Directory\\ Background\\ ShellEx\\ ContextMenuHandlers\\ %s" , ShellExtensionClassName);
1240- if (!win32_registry::deleteKey (key.c_str ()))
1240+ if (!win32_registry::DeleteKey (key.c_str ()))
12411241 return E_ACCESSDENIED;
12421242 }
12431243
12441244 // Unregister the shell extension for folders
12451245 {
12461246 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ Folders\\ shellex\\ ContextMenuHandlers\\ %s" , ShellExtensionClassName);
1247- if (!win32_registry::deleteKey (key.c_str ()))
1247+ if (!win32_registry::DeleteKey (key.c_str ()))
12481248 return E_ACCESSDENIED;
12491249 }
12501250
12511251 // Unregister the shell extension for directories
12521252 {
12531253 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ Directory\\ shellex\\ ContextMenuHandlers\\ %s" , ShellExtensionClassName);
1254- if (!win32_registry::deleteKey (key.c_str ()))
1254+ if (!win32_registry::DeleteKey (key.c_str ()))
12551255 return E_ACCESSDENIED;
12561256 }
12571257
12581258 // Unregister the shell extension for all the file types
12591259 {
12601260 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ *\\ shellex\\ ContextMenuHandlers\\ %s" , ShellExtensionClassName);
1261- if (!win32_registry::deleteKey (key.c_str ()))
1261+ if (!win32_registry::DeleteKey (key.c_str ()))
12621262 return E_ACCESSDENIED;
12631263 }
12641264
12651265 // Remove the CLSID of this DLL from the registry
12661266 {
12671267 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ CLSID\\ %s" , guid_str);
1268- if (!win32_registry::deleteKey (key.c_str ()))
1268+ if (!win32_registry::DeleteKey (key.c_str ()))
12691269 return E_ACCESSDENIED;
12701270 }
12711271
12721272 // Unregister current and version 1 of our extension
12731273 {
12741274 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ %s" , class_name_version1.c_str ());
1275- if (!win32_registry::deleteKey (key.c_str ()))
1275+ if (!win32_registry::DeleteKey (key.c_str ()))
12761276 return E_ACCESSDENIED;
12771277 }
12781278 {
12791279 std::string key = ra::strings::Format (" HKEY_CLASSES_ROOT\\ %s" , ShellExtensionClassName);
1280- if (!win32_registry::deleteKey (key.c_str ()))
1280+ if (!win32_registry::DeleteKey (key.c_str ()))
12811281 return E_ACCESSDENIED;
12821282 }
12831283
0 commit comments