commit cafe4147aab8b14879560df53ad3a269304dec5b Author: jdg Date: Sun Sep 12 21:55:59 2021 +0200 First commit 18/07/2000 diff --git a/Apagar.cpp b/Apagar.cpp new file mode 100644 index 0000000..13517d1 --- /dev/null +++ b/Apagar.cpp @@ -0,0 +1,56 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "Apagar.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TForm1 *Form1; +//--------------------------------------------------------------------------- +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::Timer1Timer(TObject *Sender) +{ + if ( CheckBox1->Checked ) + { + TDateTime hm = TDateTime::CurrentTime(); + unsigned short h, m, s, ss; + hm.DecodeTime( &h, &m, &s, &ss ); + if ( h == Edit1->Text.ToInt() && m >= Edit2->Text.ToInt() ) + { + + if (!ExitWindowsEx(EWX_SHUTDOWN | EWX_FORCE | EWX_POWEROFF, 0)) + { + ShowMessage( "Error Cerrando el EQUIPO\nIntente cierre manual" ); + } + } + + } +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::Edit2Change(TObject *Sender) +{ + try { + if ( Edit2->Text.ToInt() < 0 || Edit2->Text.ToInt() >59 ) Edit2->Text = "0"; + } catch(...) { Edit2->Text = "0"; + Edit2->SelStart= 0; + Edit2->SelLength= 1; + } +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::Edit1Change(TObject *Sender) +{ + try { + if ( Edit1->Text.ToInt() < 0 || Edit1->Text.ToInt() > 23 ) Edit1->Text = "0"; + } catch(...) { Edit1->Text = "0"; + Edit1->SelStart= 0; + Edit1->SelLength= 1; + } +} +//--------------------------------------------------------------------------- diff --git a/Apagar.dfm b/Apagar.dfm new file mode 100644 index 0000000..d9da67d Binary files /dev/null and b/Apagar.dfm differ diff --git a/Apagar.h b/Apagar.h new file mode 100644 index 0000000..150f7fc --- /dev/null +++ b/Apagar.h @@ -0,0 +1,31 @@ +//--------------------------------------------------------------------------- +#ifndef ApagarH +#define ApagarH +//--------------------------------------------------------------------------- +#include +#include +#include +#include +#include +#include +//--------------------------------------------------------------------------- +class TForm1 : public TForm +{ +__published: // IDE-managed Components + TCheckBox *CheckBox1; + TTimer *Timer1; + TComboBox *Edit2; + TComboBox *Edit1; + TShape *Shape3; + TShape *Shape4; + void __fastcall Timer1Timer(TObject *Sender); + void __fastcall Edit2Change(TObject *Sender); + void __fastcall Edit1Change(TObject *Sender); +private: // User declarations +public: // User declarations + __fastcall TForm1(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TForm1 *Form1; +//--------------------------------------------------------------------------- +#endif diff --git a/AutoOff.bpr b/AutoOff.bpr new file mode 100644 index 0000000..ce0edd0 --- /dev/null +++ b/AutoOff.bpr @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=3082 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[HistoryLists\hlIncludePath] +Count=1 +Item0=$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=1 +Item0=..\componentes;..\jd soft;..\componentes\cdopping;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=1 +Item0=_RTLDLL + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + + \ No newline at end of file diff --git a/AutoOff.cpp b/AutoOff.cpp new file mode 100644 index 0000000..04b09bf --- /dev/null +++ b/AutoOff.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("AutoOff.res"); +USEFORM("Apagar.cpp", Form1); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TForm1), &Form1); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/AutoOff.exe b/AutoOff.exe new file mode 100644 index 0000000..79224c6 Binary files /dev/null and b/AutoOff.exe differ diff --git a/AutoOff.res b/AutoOff.res new file mode 100644 index 0000000..870cf82 Binary files /dev/null and b/AutoOff.res differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..a628b0a --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +#06-jul-2002 + + +*18/07/2000* + +ToDo: wwtcf? + + +![screenshot](/06-jul-2002.png "Screenshot")