void __fastcall TRegAssociationsForm::ButtonExitClick(TObject *Sender)
{
  TRegistry * reg = new TRegistry ();
  try
  {
    reg->RootKey = HKEY_LOCAL_MACHINE;

    if (reg->KeyExists("\\SOFTWARE\\Gis center\\Journal\\Associations"))
        reg->DeleteKey("\\SOFTWARE\\Gis center\\Journal\\Associations");

    reg->OpenKey ("\\SOFTWARE\\Gis center\\Journal\\Associations", true);

    for (int row = 1; row < ValueListEditorAssoc->RowCount; row++)
    {
      reg->WriteString (ValueListEditorAssoc->Cells [0][row],
                        ValueListEditorAssoc->Cells [1][row]);
    }

    reg->CloseKey();
  }
  __finally
  {
    safe_delete (reg);
    //delete reg;
  }
}
//---------------------------------------------------------------------------
bool __fastcall TXirconForm::EraseXircServers( void )
// Delete XiRCON Server list
{
  TRegistry * MyRegistry = new TRegistry();

  try
  {
    MyRegistry->RootKey = HKEY_CURRENT_USER;

    try
    {
      MyRegistry->DeleteKey(RegKey);
    }
    catch(ERegistryException &E)
    {
      return false;
    }
  }
  __finally
  {
    if ( MyRegistry )
      delete MyRegistry;
  }

  return true;
}
Beispiel #3
0
//---------------------------------------------------------------------------
void __fastcall TMainForm::actUnregisterExecute(TObject *Sender)
{
  try
  {
    TRegistry *reg = new TRegistry;
    reg->RootKey = HKEY_CLASSES_ROOT;
    reg->DeleteKey(".avm");
    reg->DeleteKey("AVBARMatrix");
    reg->DeleteKey(".avl");
    reg->DeleteKey("AVBARStudList");
    delete reg;
    Application->MessageBoxA("File types have been successfully unregistered!",
      "Register", MB_OK | MB_ICONINFORMATION);
  }
  catch (Exception &)
  {
    ShowError("An unrecognized error during registering!");
  }
}