19 October 2011

Effand Nozh

Membuat Auto Shut Down Di Delphi 7

Tugas lagi dari bapak Dosen Pemrograman yang kali ini disuruh membuat Program Delphi yang bisa auto Shutdown . ..

setelah kesana kemari mencari akhirnya dapat juga
Karena Sudah jadi langsung aja saya bagikan.
seperti ini scriptnya ..

##source



Auto Shutdown


procedure TForm1.FormShow(Sender: TObject);
begin
DateTimePicker1.Time:=Now;
Timer1.Enabled:=false;
end;

procedure TForm1.btnkeluarClick(Sender: TObject);
begin
close;
end;

procedure TForm1.btnaktifkanClick(Sender: TObject);
begin
if btnaktifkan.Caption=’Aktifkan Auto Shutdown’ then
begin
timer1.Enabled:=true;
DateTimePicker1.Enabled:=false;
btnaktifkan.Caption:=’Batalkan Auto Shutdown’;
Application.Minimize;
end
else
begin
timer1.Enabled:=false;
DateTimePicker1.Enabled:=true;
btnaktifkan.Caption:=’Aktifkan Auto Shutdown’;
end;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
j1,m1,d1,md1 : Word;
j2,m2,d2,md2 : word;
begin
DecodeTime(now,j1,m1,d1,md1);
DecodeTime(DateTimePicker1.Time,j2,m2,d2,md2);
if (j2=j1) and (m2=m1) and (d2=d1) then
begin
btnaktifkan.Click;
ExitWindowsEx(EWX_SHUTDOWN,0);
end;
end;

end.




Effand Nozh

About Effand Nozh -

Author Description here.. Nulla sagittis convallis. Curabitur consequat. Quisque metus enim, venenatis fermentum, mollis in, porta et, nibh. Duis vulputate elit in elit. Mauris dictum libero id justo.

Subscribe to this Blog via Email :