Get registry values for ShellExtension
| 283 | |
| 284 | /// Get registry values for ShellExtension |
| 285 | void 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 |
| 312 | void PropShell::OnAddToExplorer() |
nothing calls this directly
no test coverage detected