Cara Membuat Auto Shut Down Di Delphi 7

Advertise with Anonymous Ads


##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.


Source : http://obatbodoh.blogspot.com/2011/10/membuat-auto-shut-down-di-delphi-7.html

Related Posts:

0 Response to "Cara Membuat Auto Shut Down Di Delphi 7"

Post a Comment