Saturday, 2017-09-23, 10:44 PM
Welcome Guest | RSS

Tutorial Komputer™ Cinema Top 1

TwitterFacebook WELCOME TO TUTORIAL KOMPUTER FOR ALL- WWW.TUTOR-KOMPUTER.UCOZ.COM TUTORIAL KOMPUTER, TIDAK MENERIMA REQUEST CHEAT. MOHON MAAF ATAS KETIDAKNYAMANAN NYA INI | BUAT SOBAT TUTORIAL KOMPUTER YANG SUDAH ME-REQUEST SOFTWARE, BISA LANGSUNG DI CEK SOFTWARE ATAU DENGAN SEARCH DI BAGIAN ATAS | BELI DVD SOFTWARE, TUTORIAL MURAH HANYA DI XP-STORE | TERIMA KASIH ATAS KUNJUNGAN NYA |
 
[ New messages · Members · Forum rules · Search · RSS ]
Page 1 of 11
Forum » Pemrograman » Delphi » Tips - triks, component, program database delphi and utiliti
Tips - triks, component, program database delphi and utiliti
yosephdDate: Sunday, 2010-10-03, 5:48 AM | Message # 1
Student
Group: Users
Messages: 2
Reputation: 0
Status: Offline
Selamat datang kembali sorry nich telat banget buat bikin tulisan soalnya ci gua sakit uyyyyy....... makasih buat mas eko yag udah ngasih saran?Huh?? dan sekarang kita bikin 3 topik buat Database, WinAPI TAPI, Campuran Coding?HuhHuh?? Tolong bantuin buat nulis dan saran-saran nya yahhhh
Jangan bosen buka topik coz, topik ini pasti terus ditambahin tips, trik, and databasenya oceh, terus kalo bisa bantuin juga donks nulis tips disini, biar bisa niron ilmunya gituuu.

Ayo Bikinin AutoRun program buat kalian yang belum bikin
Untuk contoh kalian hanya masukkan Komponen CheckBox satu biji aja.
Coding :
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;

type
TForm1 = class(TForm)
CheckBox1: TCheckBox;
procedure CheckBox1Click(Sender: TObject);
private
//bikin proceure buat nyimpan konfig ke registry
procedure SaveSetting(Key, Item:String; Value:String);
//procedure buat ngehapus Reg_SZ yang dibikin
procedure RemoveSetting(Key: String);
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation
//Jangan lupa pake uses registry OK
uses
Registry;
const
//RootKey untuk AutoRun di HKCU
StarUp = 'Software\Microsoft\Windows\CurrentVersion\Run';

{$R *.dfm}

procedure TForm1.SaveSetting(Key, Item:String; Value:string);
var
Reg : TRegIniFile;
begin
Reg := TRegIniFile.Create(Key);
Reg.WriteString('',Item,Value);
Reg.Free;
end;

procedure TForm1.RemoveSetting(Key: String);
var
Reg : TRegIniFile;
begin
Reg := TRegIniFile.Create(Key);
Reg.EraseSection('');
Reg.Free;
end;

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
if CheckBox1.Checked then
//Nama Key ‘Nama aplikasi kamu’, application.exe alamat dari aplikasi kamu’
SaveSetting(StarUp, 'AutoRun' , Application.ExeName)
else
RemoveSetting(StarUp);
end;

end.

Kalo Dah compile terus Cek di Registry HKCU\Software\Microsoft\Windows\CurrentVersion\Run, kalo dah ada LogOff Computernya.

Cek Total Phsycal memory komputer kamu :
Masukkan 4 buah Label :
Label1 properti captionnya jadi “Total memory”, label2 property captionnya jadi “Memori yang digunakan”, Label3 rubah property Namenya jadi lbltotal, Label4 lbldigunakan
Coding :
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
lbltotal: TLabel;
lbldigunakan: TLabel;
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
//Jangan lupa pake variable ini
Memori : TMemoryStatus;

implementation

{$R *.dfm}

//Bikinin eventhandler OnActivate Form
procedure TForm1.FormActivate(Sender: TObject);
begin
GlobalMemoryStatus(Memori);
lbltotal.Caption := FormatFloat('#,###" KB"',Memori.dwTotalPhys/1024);
lbldigunakan.Caption := Format('%d %%',[Memori.dwMemoryLoad]);
end;

end.

Sekarang kita lihat memory yang tersisa nya berapa
Aplikasi baru, Masukkan Satu komponen StatusBar rubah property Panels tambah satu panels, widthnya jadiin 150, and last
Coding

unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls;
type
TForm1 = class(TForm)
StatusBar1: TStatusBar;
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormActivate(Sender: TObject);
var
memori : TMemoryStatus;
begin
GlobalMemoryStatus(memori);
StatusBar1.Panels[0].Text := Format('Memori tersisa: %.1f%%',
[100. * memori.dwAvailPhys / memori.dwTotalPhys]);
end;

end. coba yaa..

 
Forum » Pemrograman » Delphi » Tips - triks, component, program database delphi and utiliti
Page 1 of 11
Search: