_Viktor Master


Registrado: 20 Jul 2003Mensajes: 463Ubicación: Santiago, Los Angeles - Chile
|
Publicado: Mar 26 Ago, 2003 5:46 am Asunto: Evitar el protector de pantallas y cambiar su timer... |
|
|
Los comentarios lo dicen todo...
| Código: | __fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
// Ver si estaba activo y averiguar su timer
BOOL bActive;
int nTimeout;
SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, &bActive, 0);
SystemParametersInfo(SPI_GETSCREENSAVETIMEOUT, 0, &nTimeout, 0);
if(bActive)
Label1->Caption = "el protector estaba activo";
else
Label1->Caption = "el protector fue cerrado";
Label2->Caption = "Timer del protector = " + IntToStr(nTimeout);
}
//---------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
// Habilitar protector.
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, TRUE, NULL, 0);
}
//---------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
// Deshabilitar protector
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, FALSE,NULL, 0);
}
//---------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
// Setear el timer en 30 segundos.
SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT, 30, NULL, 0);
}
|
_________________ "Ser inteligente no es ser mas, solo equivocarse menos y no usar Visual Basic"
Atte.
Victor Yañez
Apoyen el Proyecto OpenSource del Club Builder. Ya tenemos componentes Listos!!! |
|