Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > C++ Builder
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 15-06-2004
Avatar de delphi.com.ar
delphi.com.ar delphi.com.ar is offline
Federico Firenze
 
Registrado: may 2003
Ubicación: Buenos Aires, Argentina *
Posts: 5.964
Poder: 29
delphi.com.ar Va camino a la fama
De antemano te comento que no conozco C++ en profundidad, pero esto lo hice funcionar:
Código:
//---------------------------------------------------------------------------
#include <vcl.h>
#include <registry.hpp>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormCreate(TObject *Sender)
{
    const String Regkey = "\\software\\Mi Marca\\Mi Soft\\";

    TRegistry *MyRegistry = new TRegistry();
    try {
      MyRegistry->RootKey = HKEY_LOCAL_MACHINE;
   	  MyRegistry->OpenKey(Regkey, True);
      Button1->Enabled = MyRegistry->ReadBool(Button1->Name);
   	}
   	catch(ERegistryException &E) {
 	  ShowMessage(E.Message);
      delete MyRegistry;
      return;
    }
   	delete MyRegistry;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormDestroy(TObject *Sender)
{
    const String Regkey = "\\software\\Mi Marca\\Mi Soft\\";

    TRegistry *MyRegistry = new TRegistry();
    try {
      MyRegistry->RootKey = HKEY_LOCAL_MACHINE;
   	  MyRegistry->OpenKey(Regkey, True);
      MyRegistry->WriteBool(Button1->Name, Button1->Enabled);
   	}
   	catch(ERegistryException &E) {
 	  ShowMessage(E.Message);
      delete MyRegistry;
      return;
    }
   	delete MyRegistry;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
  Button1->Enabled = !Button1->Enabled;
}
//---------------------------------------------------------------------------
__________________
delphi.com.ar

Dedique el tiempo suficiente para formular su pregunta si pretende que alguien dedique su tiempo en contestarla.
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 03:26:54.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi