21 May 2007

MEMBUAT PROGRAM CEK WAKTU WINDOWS

Semoga berhasil... Jika ada masalah kirim email ke : putu_dalungcity@yahoo.co.id
Nama : Abryan Tata Pangarsa
Web : abryantp.blogspot.com
Sourcecode [ Membuat program cek waktu windows ] :
unit Abryan;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, XPMan;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
XPManifest1: TXPManifest;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function UpTime: string;
const
ticksperday : integer = 1000 * 60 * 60 * 24;
ticksperhour : integer = 1000 * 60 * 60;
ticksperminute : integer = 1000 * 60;
tickspersecond : integer = 1000;
var
t : longword;
d, h, m, s : integer;
begin
t := GetTickCount;
d := t div ticksperday;
dec(t, d * ticksperday);
h := t div ticksperhour;
dec(t, h * ticksperhour);
m := t div ticksperminute;
dec(t, m * ticksperminute);
s := t div tickspersecond;
Result := 'Uptime: '+IntToStr(d)+ ' Hari '+IntToStr(h)+ ' Jam '+IntToStr(m)+' Menit '+IntToStr(s)+' Detik';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.Caption:=UpTime;
end;
end.

COMMENTS :

Don't Spam Here

0 komentar to “MEMBUAT PROGRAM CEK WAKTU WINDOWS”

 

Copyright © 2009 Fresh Themes Gallery | NdyTeeN. All Rights Reserved. Powered by Blogger and Distributed by Blogtemplate4u .