Rabu, 22 Juni 2011

Cara Buat DLL sederhana di Delphi

DLL – Buat dll sederhana

Tingkatan Pemula
   
Kategori System
   
Sub Kategori DLL
   
Judul Membuat dll sederhana
   
Oleh
eko-indriyawan-png.png   Nama Eko Indriyawan
Domisili Surabaya – Darmo Satelit
Delphi Delphi 2007 for Win32
YM eko_elits
Email eko_elits@yahoo.com
Telp 031 – 605 384 36
   
Referensi
http://delphi.about.com/od/windowsshellapi/a/dll_basics.htm
  http://www.delphi3000.com/articles/article_4460.asp?SK=( login dulu, apabila belum punya account, silahkan anda register terlebih dahulu )
   
Tujuan
Mengajarkan kepada Delphier untuk membuat dll sederhana.
  spasi
Overview
Pembahasan pada artikel ini masih sederhana, sehingga masih banyak yang bisa dikembangkan sesuai dengan kebutuhan program anda nantinya. Namun paling tidak dari contoh dan pembahasan yang diberikan sudah bisa sedikit memberikan gambaran kepada delphier untuk membuat file dll.
Artikel ini sangatlah menarik, kenapa dikatakan menarik? karena dari file dll, kita bisa menyimpan beberapa fungsi dan prosedur yang secara tidak langsung ini bisa digunakan alasan untuk memperkecil jumlah baris program di program utama.
Keuntungan dengan menggunakan dll adalah bisa mengurangi besar file application hasil compile.
Diharapkan dengan contoh yang sederhana ini mampu memberikan inspirasi kepada Delphier dalam membuat program aplikasi yang lebih kompleks.
  spasi
Petunjuk : Silahkan anda ikuti langkah – langkah berikut ini dengan pelan – pelan agar bisa berjalan dengan lancar sesuai dengan petunjuk yang sudah diberikan.
  spasi
Langkah 1
Pilih menu File. ( tekan tombol Alt + F ).
   
Langkah 2
Lanjutkan dengan memilih sub menu New ( tekan tombol N ).
   
Langkah 3
Setelah itu pilih item Other…( tekn tombol O ). Tunggu beberapa saat hingga didapatkan tampilan kotak dialog seperti berikut ini.
   
  pemulasystemdll0001.jpg
   
Langkah 4 Pilih item categories-nya dengan Delphi Projects.
   
Langkah 5
Pada bagian windows sebelah kanan, silahkan pilih item DLL Wizard.
   
Langkah 6
Lanjutkan dengan menekan tombol OK. Tunggu beberapa saat hingga didapatkan kode program seperti berikut ini.
   
 
libraryProject1;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library’s USES clause AND your project’s (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL–even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }

uses
SysUtils,
Classes;

{$R *.res}
begin
end.
   
Langkah 7
Silahkan anda simpan project tersebut dengan nama ContohDLL.
   
Langkah 8 Silahkan anda buat fungsi PesanYangAndaSampaikan. Untuk lebih jelasnya silahkan anda lihat potongan kode program dibawah ini.
   
 


function PesanYangAndaSampaikan(var data : string): string; export;
begin

result:= ‘Pesan yang anda sampaikan adalah ‘+QuotedStr(data);
end;

   
  Berdasarkan potongan kode program diatas, jangan lupa untuk mengakhiri fungsi dengan export
   
Langkah 9 Lakukan proses export fungsi. Untuk lebih jelasnya silahkan anda lihat potongan kode program dibawah ini.
   
 


exportsPesanYangAndaSampaikan;

   
  Kode Program secara lengkap dapat anda lihat pada listing program berikut ini.
   
 
libraryContohDLL;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library’s USES clause AND your project’s (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL–even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }

uses
SysUtils,
Classes;

{$R *.res}
PesanYangAndaSampaikan(var data : string): string; export;
begin

result := ‘Pesan yang anda sampaikan adalah ‘+QuotedStr(data);
end;
exportsPesanYangAndaSampaikan;
begin
end.
   
Langkah 8
Silahkan anda compile. Tekan tombol Ctrl + F9. Tunggu beberapa saat… ( Sedang di cek kode programnya ).
   
  Apabila tidak muncul pesan error, berarti program yang anda buat telah berhasil dan silahkan anda cek pada folder dari project tersebut disimpan. Jika didapatkan file dengan nama ContohDLL.dll, maka itu berarti file dll sudah berhasil dibuat.
  spasi
Langkah 11
Program sudah selesai anda buat dan silahkan program aplikasinya anda tutup.
  spasi
Harapan
Semoga artikel ini bisa bermanfaat. Silahkan anda berikan informasi ini kepada teman – teman anda yang belum tahu. Mari kita wujudkan kemajuan IT Indonesia bersama dengan teman – teman yang lain dengan Delphi sebagai media pemupuk kebersamaan.
   
Download
Membuat file dll sederhana
Silahkan anda download link diatas untuk mendapatkan contoh program aplikasi secara lengkap.
Ada beberapa masukan dan keluhan dari teman – teman, bahwa ada beberapa program contoh tidak bisa dijalankan dari delphi 7. Hal ini dikarenakan program contoh dibuat dengan menggunakan Delphi 2007 for win32.
Apabila anda menggunakan D7, sebaiknya anda mengikuti pandauan dari langkah – langkah yang sudah diberikan.
Atas perhatiannya, saya mengucapkan banyak terimakasih.
   
Link terkait  
   
Buku panduan
Dasar First Step To Be A Programmer
Menengah Pemrograman Database dengan Delphi dan MS SQL Server
Menengah Membangun database MLM

Senin, 07 Februari 2011

Mengubah Background Toolbar Windows Explorer dgn Gambar Bitmap


Program ini menjelaskan tentang mengubah background toolbar windos Explorer dengan gambar bitmap. Yang dilakukan program ini sangat sederhana, yakni memberikan data value BackBitmapShell pada key HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Toolbat dan nilainya merupakan path file bitmap yang digunakan.
Pada Fom rancang 2 Button dan poperty Dialog dengan mengambil OpenPictureDialog, dan juga EditText

Ini Listing program selengkapnya

Procedure Tform1.Button1Click(Sender:TObject);
begin
if OpenPictureDialog1.Execute then
Edit1.Text:=OpenPicutreDialog1.FileName;
end;

Procedure Tfrom1.Button2Click(Sender:TObject);
var Register:Tregister;
begin
Register:=Tregister.create;
Register.RootKey:=HKEY_CURRENT_USER;
try
try
Register.OpenKey('\Software\Microsoft\Internet Explorer\'+ 'Toolbar',True);
Register.WriteString('BackBitmapShell',Edit1.Text);
ShowMessage('Berhasil mengubah background toolbar'+#13+'Untuk melihat hasilnya,buka'+
' "Windows Explorer" baru.');
Except on ERegistryException do
ShowMessage('Gagal mengubah background toolbar explorer');
end;
Finally
Register.CloseKey;
Register.Free;
end;

Jumat, 24 Desember 2010

Membuat Menu Melayang Pada Blogger

Membuat Menu Melayang Pada Blogger

Berbagai macam cara dilakukan para blogger untuk menghemat ruang blognya salah satunya dengan Kotak blogroll, Namun tips kali ini untuk menghemat halaman kita akan membuat menu melayang. menu ini dapat sobat tampilkan di bagian kiri maupun di bagian kanan blog, sobat tinggal memilih mana yang lebih cocok untuk blog kesayangan sobat.
contoh bisa diliahat disini
Bagi sobat yang ingin menampilkan menu melayang ikuti panduan dibawah ini!

1. Masuk ke Blogger dengan ID sobat.
2. Pilih Design (Rancangn) ---> Edit HTML.
3. Back up template dulu, untuk antisipasi kalau gagal.
4. Cari kode ini : </head> pada template anda.
5. Copy Seluruh script dibawah ini, kemudian paste tepat diatas </head>
<script src='http://elmubarok.googlecode.com/files/floating1.js' type='text/javascript'/>
<script>
YOffset=150;
XOffset=0;
staticYOffset=30;
slideSpeed=20
waitTime=100;
menuBGColor=&quot;red&quot;;
menuIsStatic=&quot;yes&quot;;
menuWidth=150;
menuCols=2;
hdrFontFamily=&quot;verdana&quot;;
hdrFontSize=&quot;2&quot;;
hdrFontColor=&quot;black&quot;;
hdrBGColor=&quot;#FF0000&quot;;
hdrAlign=&quot;left&quot;;
hdrVAlign=&quot;center&quot;;
hdrHeight=&quot;15&quot;;
linkFontFamily=&quot;Verdana&quot;;
linkFontSize=&quot;2&quot;;
linkBGColor=&quot;white&quot;;
linkOverBGColor=&quot;#FFFF99&quot;;
linkTarget=&quot;_top&quot;;
linkAlign=&quot;Left&quot;;
barBGColor=&quot;red&quot;;
barFontFamily=&quot;Verdana&quot;;
barFontSize=&quot;2&quot;;
barFontColor=&quot;white&quot;;
barVAlign=&quot;center&quot;;
barWidth=20; // no quotes!!
barText=&quot;WELCOME&quot;;


// ----- Mulai Edit Menu
ssmItems[0]=[&quot;My Menu&quot;] //Header Menu
ssmItems[1]=[&quot;Home&quot;, &quot;/&quot;, &quot;&quot;]
ssmItems[2]=[&quot;About Me&quot;, &quot;http://www.tipskom.co.cc/2009/07/about-me.html&quot;,&quot;&quot;]
ssmItems[3]=[&quot;Blog Tutorial&quot;, &quot;http://www.tipskom.co.cc/search/label/Blog%20Tuturial&quot;,&quot;&quot;]
ssmItems[4]=[&quot;Tips FaceBook&quot;, &quot;http://www.tipskom.co.cc/search/label/Tips%20Facebook&quot;,&quot;&quot;]
ssmItems[5]=[&quot;Tips Komputer&quot;, &quot;http://www.tipskom.co.cc/search/label/Tips%20Komputer&quot;, &quot;_new&quot;]
ssmItems[6]=[&quot;Free Antivirus&quot;, &quot;http://www.tipskom.co.cc/2009/07/free-antivirus.html&quot;, &quot;&quot;]
ssmItems[7]=[&quot;SEO&quot;, &quot;http://www.tipskom.co.cc/search/label/Tips%20SEO&quot;, &quot;&quot;]

buildMenu();
//----- Selesai Edit Menu
</script>

  • silahkan rubah WELCOME dengan tulisan apa saja yang cocok dengan kehendak sobat
  • kode yang berwarna biru wajib sobat ganti dengan alamat-2 punya sobat. 
  • MY MENU boleh kita ganti dengan MENUKU, DAFTAR MENU dll.
  • masih banyak lagi yang bisa sobat utak-atik.
  • terakhir simpan. semoga berhasil

Yahoo ! Messenger Emoticons

Yahoo ! Messenger Emoticons

Buat kawan-kawan yang ingin menghiasi posting-annya dengan berbagai ekspresi dari yahoo, saya berikan source codenya, biar anda bebas ngakak atau cemberut selagi posting. Silahkan copy source code berikut, sisipkan pada kata yang sesuai dengan postingan anda, kalo lagi sedih jangan di pasang yang lagi ngakak, trus kalo lagi patah hati ya nyengir aja ya...            


happy:)happy
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/1.gif" width=18 height=18 border=0>

sad:(sad
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/2.gif" width=18 height=18 border=0>

winking;)winking
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/3.gif" width=18 height=18 border=0>

big grin:Dbig grin
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/4.gif" width=18 height=18 border=0>

batting eyelashes;;)batting eyelashes
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/5.gif" width=18 height=18 border=0>

big hug>:D<big hug
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/6.gif" width=42 height=18 border=0>

confused:-/confused
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/7.gif" width=20 height=18 border=0>

love struck:xlove struck
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/8.gif" width=18 height=18 border=0>

blushing:">blushing
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/9.gif" width=18 height=18 border=0>

tongue:Ptongue
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/10.gif" width=18 height=18 border=0>

kiss:-*kiss
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/11.gif" width=18 height=18 border=0>

broken heart=((broken heart
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/12.gif" width=18 height=18 border=0>

surprise:-Osurprise
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/13.gif" width=18 height=18 border=0>

angryX(angry
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/14.gif" width=34 height=18 border=0>

smug:>smug
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/15.gif" width=18 height=18 border=0>

coolB-)cool
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/16.gif" width=18 height=18 border=0>

worried:-Sworried
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/17.gif" width=18 height=18 border=0>

whew!#:-Swhew!
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/18.gif" width=34 height=18 border=0>

devil>:)devil
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/19.gif" width=18 height=18 border=0>

crying:((crying
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/20.gif" width=22 height=18 border=0>

laughing:))laughing
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/21.gif" width=18 height=18 border=0>

straight face:straight face
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/22.gif" width=18 height=18 border=0>

raised eyebrow/:)raised eyebrow
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/23.gif" width=18 height=18 border=0>

rolling on the floor=))rolling on the floor
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/24.gif" width=30 height=18 border=0>

angelO:-)angel
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/25.gif" width=30 height=18 border=0>

nerd:-Bnerd
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/26.gif" width=24 height=18 border=0>

talk to the hand=;talk to the hand
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/27.gif" width=18 height=18 border=0>

Yahoo hidden emoticons



puppy dog eyes - New!:o3puppy dog eyes - New!

<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/108.gif" width=31 height=18 border=0>

I don't know:-??I don't know
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/106.gif" width=40 height=18 border=0>

not listening%-(not listening
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/107.gif" width=52 height=18 border=0>

pig:@)pig
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/49.gif" width=18 height=18 border=0>

cow3:-Ocow
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/50.gif" width=18 height=18 border=0>

monkey:()monkey
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/51.gif" width=21 height=18 border=0>

chicken~:>chicken
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/52.gif" width=18 height=18 border=0>

rose@};-rose
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/53.gif" width=18 height=18 border=0>

good luck%%-good luck
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/54.gif" width=18 height=18 border=0>

flag**==flag
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/55.gif" width=25 height=18 border=0>

pumpkin(~~)pumpkin
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/56.gif" width=17 height=18 border=0>

coffee~O)coffee
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/57.gif" width=18 height=18 border=0>

idea*-:)idea
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/58.gif" width=30 height=18 border=0>

skull8-Xskull
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/59.gif" width=18 height=18 border=0>

bug=:)bug
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/60.gif" width=20 height=18 border=0>

alien>-)alien
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/61.gif" width=18 height=18 border=0>

frustrated:-Lfrustrated
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/62.gif" width=18 height=18 border=0>

praying[-O<praying
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/63.gif" width=18 height=18 border=0>

money eyes$-)money eyes
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/64.gif" width=18 height=18 border=0>

whistling:-"whistling
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/65.gif" width=22 height=18 border=0>

feeling beat upb-(feeling beat up
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/66.gif" width=18 height=18 border=0>

peace sign:)>-peace sign
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/67.gif" width=22 height=18 border=0>

shame on you[-Xshame on you
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/68.gif" width=22 height=18 border=0>

dancing\:D/dancing
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/69.gif" width=26 height=18 border=0>

bring it on>:/bring it on
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/70.gif" width=23 height=18 border=0>

hee hee;))hee hee
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/71.gif" width=18 height=18 border=0>

chatterbox:-@chatterbox
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/76.gif" width=36 height=18 border=0>

not worthy^:)^not worthy
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/77.gif" width=32 height=18 border=0>

oh go on:-joh go on
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/78.gif" width=26 height=18 border=0>

star(*)star
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/79.gif" width=18 height=18 border=0>

hiroo->hiro
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/72.gif" width=18 height=18 border=0>

billyo=>billy
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/73.gif" width=18 height=18 border=0>

aprilo-+april
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/74.gif" width=18 height=18 border=0>

yin yang(%)yin yang
<img src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/75.gif" width=18 height=18 border=0>

Selamat mempercantik postingan nya...