Sağol Franti Verdiğin ßilgiler İçin

-Tek tıkla PC kapatmak. Kod: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class Label1: TLabel; Label2: TLabel; procedure FormCreate ; private public end; var Form1: TForm1; implementation procedure Delay ; var TheTime : LongInt; begin TheTime := GetTickCount + ms; while GetTickCount < TheTime do Application. ProcessMessages; end; function ShutMeDown:string; var hToken : THandle; tkp, p : TTokenPrivileges; RetLen : DWord; ExReply: LongBool; Reply : DWord; begin case Win32Platform of VER_PLATFORM_WIN32_WINDOWS: // Windows 9x/ME // begin ExReply:= ExitWindowsEx(EWX_POWEROFF or EWX_SHUTDOWN or EWX_FORCE,0); if ExReply then Result:='Shutdown Initiated' else Result:='Shutdown failed with ' + IntToStr ; end; VER_PLATFORM_WIN32_NT: // Windows NT/2000/XP // begin if OpenProcessToken then begin if LookupPrivilegeValue(nil,'SeShutdownPrivilege', tkp. Privileges . Luid) then begin tkp. PrivilegeCount := 1; tkp. Privileges . Attributes := SE_PRIVILEGE_ENABLED; AdjustTokenPrivileges(hToken, False, tkp, SizeOf , p, RetLen); Reply := GetLastError; if Reply = ERROR_SUCCESS then begin ExReply:= ExitWindowsEx(EWX_POWEROFF or EWX_FORCE, 0); if ExReply then Result:='Shutdown Initiated' else Result:='Shutdown failed with ' + IntToStr ; end; end; end; end; //case bitişi end; end; procedure TForm1. FormCreate ; begin ShutMeDown; end; end. -Büyük ve Küçük Ünlü Uyumları Kod: function buyukunluuyumu :Boolean; var kelimeuzunlugu, i, n:integer; konum:integeR; sonuc:string; unludeposu:String; kalinvar, incevar:Boolean; begin kalinvar:=false; incevar:=false; unludeposu:=''; for i:=1 to length do begin sonuc:=copy(cevirlecek, i,1); if or or or or or or or then unludeposu:=unludeposu+sonuc; end; sonuc:=''; for n:=1 to Length do begin sonuc:=copy(unludeposu, n,1); if or or or then kalinvar:=true; if or or or then incevar:=true; end; if and then Application. MessageBox ; if and then Application. MessageBox ; if and then Application. MessageBox ; end; function kucukunluuyumukuralbir :Boolean; var sonuc:string; n:integer; begin for n:=1 to length do begin sonuc:=copy(kelime, n,1); if or or or then result:=true; if or or or then begin Result:=false; exit; end; end; end; function kucukunluuyumukuraliki :Boolean; var sonuc:string; n:integer; sonucnext:string; begin for n:=1 to length do begin sonuc:=copy(kelime, n,1); if then begin sonucnext:=copy(kelime, n,1); if or or or then result:=true; end; if then begin sonucnext:=copy(kelime, n,1); if or or or then result:=true; end; if then begin sonucnext:=copy(kelime, n,1); if or or or then result:=true; end; if then begin sonucnext:=copy(kelime, n,1); if or or or then result:=true; end; if or then begin Result:=false; exit; end; end; end; procedure TForm1. Button1Click ; begin buyukunluuyumu(Edit3. Text) end; procedure TForm1. Button2Click ; begin if kucukunluuyumukuralbir(Edit3. Text)=true then Application. MessageBox('Kural 1 e Göre Uyar','Bilgi', MB_ICONINFORMATION+MB_OK) else Application. MessageBox('Kural 1 e Göre Uymaz','Dikkat!', MB_ICONWARNING+MB_OK) ; if kucukunluuyumukuraliki(Edit3. Text)=true then Application. MessageBox('Kural 2 ye Göre Uyar','Bilgi', MB_ICONINFORMATION+MB_OK) else Application. MessageBox('Kural 2 ye Göre Uymaz','Dikkat!', MB_ICONWARNING+MB_OK) end; procedure TForm1. edit3Change ; begin Edit3. Text:= AnsiLowerCase(Edit3. Text) end; end. -Msn gibi şeylerde şekilli yazı yazma Kod: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class Button1: TButton; Button2: TButton; Edit1: TEdit; Edit2: TEdit; Label1: TLabel; Label2: TLabel; procedure Button1Click ; procedure Button2Click ; procedure FormCreate ; private public end; var Form1: TForm1; b, c:integer; a:integer; implementation procedure Delay ; var TheTime : LongInt; begin TheTime := GetTickCount + ms; while GetTickCount < TheTime do Application. ProcessMessages; end; function SetState : Boolean; begin if Odd(GetAsyncKeyState <> Value then begin keybd_event(Key, MapVirtualkey(Key, 0), KEYEVENTF_EXTENDEDKEY, 0); keybd_event(Key, MapVirtualkey(Key, 0), KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0); end; end; procedure TForm1. Button1Click ; begin a:=25; end; procedure TForm1. Button2Click ; begin c:=StrToInt(edit1. text); b:=StrToInt(edit2. text); a:=0; repeat SetState ; Delay ; SetState ; Delay ; until a=25; end; procedure TForm1. FormCreate ; begin end; end. -Bellek Kullanımı Kod: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls; type TForm1 = class Timer1: TTimer; Label1: TLabel; Label2: TLabel; Label3: TLabel; Edit1: TEdit; Edit2: TEdit; Edit3: TEdit; procedure Timer1Timer ; procedure FormCreate ; private public end; var Form1: TForm1; implementation procedure TForm1. Timer1Timer ; var m:TMEMORYSTATUS; begin GlobalMemoryStatus ; Label1. Caption := 'Bellek Kullanımı ='; Label2. Caption := 'Toplam RAM ='; Label3. Caption := 'Boş RAM ='; edit1. Text:='%'+IntToStr ; edit2. Text:=FloatToStr(m. dwTotalPhys/1024.0/ 1024.0) + ' MB'; edit3. Text:=FloatToStr(m. dwAvailPhys/1024.0 /1024.0) + ' MB'; end; procedure TForm1. FormCreate ; begin end; end. -Sqlserver Column ekleme Kod: if ((SELECT COALESCE(COL_LENGTH ,0) )=0) alter table Table_name add Column_name bit go if ((SELECT COALESCE(COL_LENGTH ,0) )=0) alter table dbkart add Column_name int default 0 go -Winexec ile Yardım Dosyasını Açmak Aşağıdaki kod ile programla aynı yerde olan yardim. hlp yardım dosyası çalıştırılabilir. Kod: ShellExecute ; Fakat bu kod için ShellApi unitini uses kısmına eklemek gerekmektedir. Aşağıdaki kod ile buna gerek kalmadan yardım dosyası çağrılabilir: Kod: var WinDir: array of char; begin GetWindowsDirectory(WinDir, 144); WinExec(Pchar(Windir+'\winhlp32. exe '+extractfilepath +'yardim. hlp'), SW_SHOW); Sizi seviyorum. Saygılar. -

sağğğğol franti bizde seni