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

Function IsWinMergeContextMenuRegistered

Src/PropShell.cpp:57–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57static bool IsWinMergeContextMenuRegistered()
58{
59#ifdef _WIN64
60 DWORD ulOptions = KEY_READ;
61#else
62 auto Is64BitWindows = []() { BOOL f64 = FALSE; return IsWow64Process(GetCurrentProcess(), &f64) && f64; };
63 DWORD ulOptions = KEY_READ | (Is64BitWindows() ? KEY_WOW64_64KEY : 0);
64#endif
65 HKEY hBaseKey;
66 bool found = false;
67 if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\AppHost\\IndexedDB"), 0, ulOptions, &hBaseKey) == ERROR_SUCCESS)
68 {
69 DWORD index = 0;
70 while (true)
71 {
72 TCHAR name[256];
73 DWORD nameLen = _countof(name);
74 if (RegEnumKeyEx(hBaseKey, index++, name, &nameLen, nullptr, nullptr, nullptr, nullptr) != ERROR_SUCCESS)
75 break;
76 if (tc::tcsncmp(name, _T("WinMerge_"), 9) == 0)
77 {
78 found = true;
79 break;
80 }
81 }
82 RegCloseKey(hBaseKey);
83 }
84 return found;
85}
86
87static bool RegisterShellExtension(bool unregister, bool peruser)
88{

Callers 2

WriteOptionsMethod · 0.85
UpdateButtonsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected