Bellek Kullanımı Öğrenme
Sürücü Kapasitesi Bulma Programı :
Fare Koordinatları Öğrenme veya Bulma
Gelişmiş Windows Gezgini Yapma
Mail Programı (Mail Gönderme Programı)
Web Browser (Tarayıcı) Programı
Programınıza Tarih ve Saat Koymak
ProgressBar Nesnesi
Şiir YaZMA pROGRAMI
Flash Çalışması
NOT : TOPLAMADIR
Kod:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "CGAUGES"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::Timer1Timer(TObject *Sender)
{
TMemoryStatus m;
GlobalMemoryStatus(&m);
double x=m.dwTotalVirtual;
Form1->Caption=x;
CGauge1->Progress=m.dwMemoryLoad;
}
//---------------------------------------------------------------------------
Sürücü Kapasitesi Bulma Programı :
Kod:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::DriveComboBox1Change(TObject *Sender)
{
int Diskno;
double boyut;
AnsiString s;
s=UpperCase(DriveComboBox1->Text);
Diskno=s[1]-64;
boyut=DiskSize(Diskno)/1024.0/1024.0/1024.0;
if(boyut>0)
Label1->Caption=FloatToStr(boyut)+" GB";
else
Label1->Caption="0 GB";
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::FormShow(TObject *Sender)
{
int Diskno;
double boyut;
AnsiString s;
s=UpperCase(DriveComboBox1->Text);
Diskno=s[1]-64;
boyut=DiskSize(Diskno)/1024.0/1024.0/1024.0;
if(boyut>0)
Label1->Caption=FloatToStr(boyut)+" GB";
else
Label1->Caption="0 GB";
}
//---------------------------------------------------------------------------
Kod:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::Timer1Timer(TObject *Sender)
{
TPoint pt;
GetCursorPos(&pt);
Label1->Caption=pt.x;
Label2->Caption=pt.y;
}
//---------------------------------------------------------------------------
Gelişmiş Windows Gezgini Yapma
Kod:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::FileListBox1DblClick(TObject *Sender)
{
String ac=FileListBox1->Items->Strings[FileListBox1->ItemIndex];
ShellExecute(0,"open",ac.c_str(),"" ,"",SW_SHOW);
}
//---------------------------------------------------------------------------
Mail Programı (Mail Gönderme Programı)
Kod:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::Button1Click(TObject *Sender)
{
IdSMTP1->Port=587;
IdSMTP1->Host=Edit5->Text;
IdSMTP1->UserId=Edit6->Text;
IdSMTP1->Password=Edit7->Text;
IdMessage1->Sender->Address=Edit1->Text;
IdMessage1->Sender->Name=Edit2->Text;
IdMessage1->From->Name=Edit2->Text;
IdMessage1->From->Address=Edit8->Text;
IdMessage1->Recipients->EMailAddresses=Edit3->Text;
IdMessage1->Subject=Edit4->Text;
IdMessage1->Body->Assign(Memo1->Lines);
try
{
IdSMTP1->Connect();
try
{
IdSMTP1->Send(IdMessage1);
Application->MessageBox("Mail Gönderildi","BİLGİ",MB_ICONINFORMATION);
IdSMTP1->Disconnect();
}
catch (Exception &E)
{
ShowMessage("Failed: " + E.Message );
IdSMTP1->Disconnect();
}
}
catch (Exception &E)
{
ShowMessage("Failed:" + E.Message );
IdSMTP1->Disconnect();
}
}
//---------------------------------------------------------------------------
Web Browser (Tarayıcı) Programı
Kod:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "sSkinManager"
#pragma link "acPNG"
#pragma link "acAlphaImageList"
#pragma link "SHDocVw_OCX"
#pragma link "sBitBtn"
#pragma link "sComboBox"
#pragma link "sButton"
#pragma link "sScrollBar"
#pragma link "sPanel"
#pragma link "sEdit"
#pragma resource "*.dfm"
TForm1 *Form1;
bool buton=false;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::sBitBtn1Click(TObject *Sender)
{
CppWebBrowser1->GoBack();
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::sBitBtn2Click(TObject *Sender)
{
CppWebBrowser1->Stop();
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::sBitBtn3Click(TObject *Sender)
{
CppWebBrowser1->GoForward();
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::sBitBtn4Click(TObject *Sender)
{
CppWebBrowser1->*******();
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::sBitBtn6Click(TObject *Sender)
{
CppWebBrowser1->Navigate(WideString("http://www.facebook.com/home.php?"));
sComboBox1->Text="http://www.facebook.com/home.php?";
Form1->Caption="Facebook - Koala Web Browser";
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::sBitBtn7Click(TObject *Sender)
{
CppWebBrowser1->Navigate(WideString("http://www.google.com"));
sComboBox1->Text="http://www.google.com";
Form1->Caption="Google - Koala Web Browser";
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::sBitBtn8Click(TObject *Sender)
{
CppWebBrowser1->Navigate(WideString("http://www.hazirprogram.com/"));
sComboBox1->Text="http://www.hazirprogram.com";
Form1->Caption="Programlama Portalınız Hazır Program Programlama Dilleri Döküman Forum - Koala Web Browser";
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::sComboBox1KeyPress(TObject *Sender, char &Key)
{
if(Key==VK_RETURN)
CppWebBrowser1->Navigate(WideString(sComboBox1->Text));
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::sEdit1KeyPress(TObject *Sender, char &Key)
{
if(Key==VK_RETURN)
{
AnsiString arama=sEdit1->Text;
sComboBox1->Text="http://www.google.com.tr/#hl=tr&source=hp&biw=1366&bih=585&q="+arama+"&aq=f&aqi=g10&aql=&oq=&gs_rfai=&fp=d409d42931bac555";
CppWebBrowser1->Navigate(WideString(sComboBox1->Text));
}
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::sBitBtn9Click(TObject *Sender)
{
AnsiString arama=sEdit1->Text;
sComboBox1->Text="http://www.google.com.tr/#hl=tr&source=hp&biw=1366&bih=585&q="+arama+"&aq=f&aqi=g10&aql=&oq=&gs_rfai=&fp=d409d42931bac555";
CppWebBrowser1->Navigate(WideString(sComboBox1->Text));
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::k1Click(TObject *Sender)
{
Form1->Close();
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::SekmeyiKapat1Click(TObject *Sender)
{
Form1->PageControl1->ActivePage->TabVisible=false;
}
//---------------------------------------------------------------------------
Programınıza Tarih ve Saat Koymak
Kod:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::Timer1Timer(TObject *Sender)
{
Form1->Caption=Now();
}
//---------------------------------------------------------------------------
ProgressBar Nesnesi
Kod:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "math.h"
**** asalbul(int);
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::Button1Click(TObject *Sender)
{
Label3->Caption=TimeToStr(Now());
ListBox1->Items->Clear();
ListBox1->Items->Add("2");
int sinir=StrToInt(Edit1->Text);
ProgressBar1->Min=0;
ProgressBar1->Max=sinir;
for(int i=3;i<=sinir;i++)
{
Application->ProcessMessages();
ProgressBar1->Position=i;
asalbul(i);
}
Label4->Caption=TimeToStr(Now());
}
//---------------------------------------------------------------------------
**** asalbul(int p)
{
int kontrol=0;
for(int register i=2;i<sqrt(p)+1;i++)
{
if(p%i==0)
{
kontrol=1;
break;
}
}
if(kontrol==0)
Form1->ListBox1->Items->Add(p);
}
Şiir YaZMA pROGRAMI
Kod:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1; int genel; int indis=-1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
**** sifirla()
{
Form1->ListBox1->Items->LoadFromFile("fiil.txt");
Form1->ListBox2->Items->LoadFromFile("isim.txt");
Form1->ListBox3->Items->LoadFromFile("sıfat.txt");
Form1->ListBox4->Items->LoadFromFile("zarf.txt");
genel=0;
}
//---------------------------------------------------------------------------
**** cumleolustur(String durum,String gelen)
{
Sleep(100);
String zarf1="",sifat="",isim="",fiil="",zarf2=""; int kontrol=0; String olustur="";
if(durum=="fiil")
{
int x=random(3);
if(x==2)
{
int z=random(Form1->ListBox4->Items->Count);
zarf1=Form1->ListBox4->Items->Strings[z]; kontrol=1;
Form1->ListBox4->Items->Delete(z);
}
int i=random(Form1->ListBox2->Items->Count);
isim=Form1->ListBox2->Items->Strings[i];
Form1->ListBox2->Items->Delete(i);
x=random(2);
if((x==1)||(kontrol==1))
{
int s=random(Form1->ListBox3->Items->Count);
sifat=Form1->ListBox3->Items->Strings[s];
Form1->ListBox3->Items->Delete(s);
}
x=random(4);
if(x==3)
{
int z=random(Form1->ListBox4->Items->Count);
zarf2=Form1->ListBox4->Items->Strings[z];
Form1->ListBox4->Items->Delete(z);
}
if(zarf1!="")
{olustur+=zarf1; olustur+=" ";}
if(sifat!="")
{olustur+=sifat; olustur+=" ";}
olustur+=isim; olustur+=" ";
if(zarf2!="")
{olustur+=zarf2; olustur+=" ";}
olustur+=gelen;
Form1->Memo1->Lines->Add(olustur);
int tut;
for(int k=0;k<Form1->ListBox1->Items->Count;k++)
{
if(gelen==Form1->ListBox1->Items->Strings[k])
{
tut=k;
break;
}
}
Form1->ListBox1->Items->Delete(tut);
indis=-1;
int saydir=0;
while(saydir<4)
{
saydir++;
String gelenilk=gelen;
if(saydir==1)
gelenilk.Delete(1,gelenilk.Length()-3);
if(saydir==2)
gelenilk.Delete(1,gelenilk.Length()-2);
if(saydir==3)
gelenilk.Delete(1,gelenilk.Length()-1);
for(int j=0;j<Form1->ListBox1->Items->Count;j++)
{
String of=Form1->ListBox1->Items->Strings[j];
if(saydir==1)
of.Delete(1,of.Length()-3);
if(saydir==2)
of.Delete(1,of.Length()-2);
if(saydir==3)
of.Delete(1,of.Length()-1);
if(gelenilk==of)
{
indis=j; saydir=4;
break;
}
}
}
if(indis==-1)
{
indis=random(Form1->ListBox1->Items->Count);
}
}
if(durum=="isim")
{
int x=random(3);
if(x==2)
{
int z=random(Form1->ListBox4->Items->Count);
zarf1=Form1->ListBox4->Items->Strings[z];
Form1->ListBox4->Items->Delete(z);
}
int i=random(Form1->ListBox1->Items->Count);
fiil=Form1->ListBox1->Items->Strings[i];
Form1->ListBox1->Items->Delete(i);
x=random(4);
if(x==3)
{
int z=random(Form1->ListBox4->Items->Count);
zarf2=Form1->ListBox4->Items->Strings[z];
Form1->ListBox4->Items->Delete(z); kontrol=1;
}
x=random(2);
if((x==1)||(kontrol==1))
{
int s=random(Form1->ListBox3->Items->Count);
sifat=Form1->ListBox3->Items->Strings[s];
Form1->ListBox3->Items->Delete(s);
}
if(zarf2!="")
{olustur+=zarf2; olustur+=" ";}
if(fiil!="")
{olustur+=fiil; olustur+=" ";}
if(zarf2!="")
{olustur+=zarf2; olustur+=" ";}
if(sifat!="")
{olustur+=sifat; olustur+=" ";}
olustur+=gelen;
Form1->Memo1->Lines->Add(olustur);
int tut;
for(int k=0;k<Form1->ListBox2->Items->Count;k++)
{
if(gelen==Form1->ListBox2->Items->Strings[k])
{
tut=k;
break;
}
}
Form1->ListBox2->Items->Delete(tut);
indis=-1;
int saydir=0;
while(saydir<4)
{
saydir++;
String gelenilk=gelen;
if(saydir==1)
gelenilk.Delete(1,gelenilk.Length()-3);
if(saydir==2)
gelenilk.Delete(1,gelenilk.Length()-2);
if(saydir==3)
gelenilk.Delete(1,gelenilk.Length()-1);
for(int j=0;j<Form1->ListBox2->Items->Count;j++)
{
String of=Form1->ListBox2->Items->Strings[j];
if(saydir==1)
of.Delete(1,of.Length()-3);
if(saydir==2)
of.Delete(1,of.Length()-2);
if(saydir==3)
of.Delete(1,of.Length()-1);
if(gelenilk==of)
{
indis=j; saydir=4;
break;
}
}
}
if(indis==-1)
{
indis=random(Form1->ListBox2->Items->Count);
}
}
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::Button1Click(TObject *Sender)
{
sifirla();
Memo1->Lines->Clear();
for(int l=0;l<3;l++)
{
Sleep(2000);
randomize();
int x=random(2);
if(x==0)
{
int p=random(ListBox1->Items->Count);
indis=p;
for(int i=0;i<5;i++)
cumleolustur("fiil",ListBox1->Items->Strings[indis]);
sifirla();
}
if(x==1)
{
int p=random(ListBox2->Items->Count);
indis=p;
for(int i=0;i<5;i++)
cumleolustur("isim",ListBox2->Items->Strings[indis]);
sifirla();
}
Memo1->Lines->Add("");
}
}
//---------------------------------------------------------------------------
Flash Çalışması
Kod:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "SHDocVw_OCX"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
**** __fastcall TForm1::FormCreate(TObject *Sender)
{
CppWebBrowser1->Navigate(WideString("C:\\Program Files\\Borland\\CBuilder6\\Projects\\Builder_Flash_Calismasi\\hakkinda.htm"));
}
//---------------------------------------------------------------------------

