MCPcopy Create free account
hub / github.com/WinMerge/winmerge / GetContextRegValues

Method GetContextRegValues

Src/PropShell.cpp:285–309  ·  view source on GitHub ↗

Get registry values for ShellExtension

Source from the content-addressed store, hash-verified

283
284/// Get registry values for ShellExtension
285void PropShell::GetContextRegValues()
286{
287 CRegKeyEx reg;
288 LONG retVal = 0;
289 retVal = reg.OpenNoCreateWithAccess(HKEY_CURRENT_USER, RegDir, KEY_READ);
290 if (retVal != ERROR_SUCCESS)
291 {
292 String msg = strutils::format(_T("Failed to open registry key HKCU/%s:\n\t%d : %s"),
293 RegDir, retVal, GetSysError(retVal));
294 RootLogger::Error(msg);
295 return;
296 }
297
298 // Read bitmask for shell extension settings
299 DWORD dwContextEnabled = reg.ReadDword(f_RegValueEnabled, 0);
300
301 if (dwContextEnabled & CONTEXT_F_ENABLED)
302 m_bContextAdded = true;
303
304 if (dwContextEnabled & CONTEXT_F_ADVANCED)
305 m_bContextAdvanced = true;
306
307 if (dwContextEnabled & CONTEXT_F_COMPARE_AS)
308 m_bContextCompareAs = true;
309}
310
311/// Set registry values for ShellExtension
312void PropShell::OnAddToExplorer()

Callers

nothing calls this directly

Calls 5

ErrorFunction · 0.85
GetSysErrorFunction · 0.70
formatFunction · 0.50
ReadDwordMethod · 0.45

Tested by

no test coverage detected