Ejemplo n.º 1
0
bool CheckContextMenuHandler()
{
  return
    // CheckHandlerCommon(GetFullContextMenuKeyName(kRootKeyNameForFolder)) &&
    CheckHandlerCommon(GetFullContextMenuKeyName(kRootKeyNameForDirectory))  &&
    CheckHandlerCommon(GetFullContextMenuKeyName(kRootKeyNameForFile)) &&
    CheckHandlerCommon(GetFullDragDropMenuKeyName(kRootKeyNameForDirectory))  &&
    CheckHandlerCommon(GetFullDragDropMenuKeyName(kRootKeyNameForDrive));
}
Ejemplo n.º 2
0
static void DeleteContextMenuHandlerCommon(const CSysString &keyName)
{
  CKey rootKey;
  rootKey.Attach(HKEY_CLASSES_ROOT);
  rootKey.RecurseDeleteKey(GetFullContextMenuKeyName(keyName));
  rootKey.Detach();
}
Ejemplo n.º 3
0
static void AddContextMenuHandlerCommon(const CSysString &keyName)
{
  DeleteContextMenuHandlerCommon(keyName);
  NSynchronization::CCriticalSectionLock lock(g_CS);
  CKey key;
  key.Create(HKEY_CLASSES_ROOT, GetFullContextMenuKeyName(keyName));
  key.SetValue(NULL, kExtensionCLSID);
}
Ejemplo n.º 4
0
static bool CheckContextMenuHandlerCommon(const CSysString &keyName)
{
  NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
  CKey key;
  if (key.Open(HKEY_CLASSES_ROOT, GetFullContextMenuKeyName(keyName), KEY_READ)
      != ERROR_SUCCESS)
    return false;
  CSysString value;
  if (key.QueryValue(NULL, value) != ERROR_SUCCESS)
    return false;
  return (value.CompareNoCase(kExtensionCLSID) == 0);
}