function AktifPencere: string;
var
Handle: THandle;
Len: LongInt;
Title: string;
begin
Result := ’’;
Handle := GetForegroundWindow;
if Handle <> 0 then
begin
Len := GetWindowTextLength(Handle) + 1;
SetLength(Title, Len);
GetWindowText(Handle, PChar(Title), Len);
AktifPencere:= TrimRight(Title);
end;
end;
Kullanımı : Edit1.text:=ActiveCaption;
Yasaklı Kelime Listesini Titledan Kontrol Etme Usesa Strutils Ekle:
function KelimeIcindeVarmi(KontrolYazi:String;Liste:TListbox):Integer;
var
i:Integer;
Kactane:Integer;
begin
Kactane:=0;
for i:=0 to Liste.Items.Count-1 do
begin
Application.ProcessMessages;
if IsStrInOtherStr(AnsiLowerCase(KontrolYazi),Liste.Items.Strings) then
begin
Kactane:=Kactane+1;
end;
end;
Result:=Kactane;
end;
Kullanımı :
if KelimeIcindeVarmi(ActiveCaption,Listbox1)>0 Then
begin
Showmessage(’Yasaklı Kelime Var!!!’)
end;
Sitenin Kaynak Kodlarını Alma KelimeIcindeVarmi Fonksyionuna Uyarlayarak Kullanabilirsin...
uses//Usesini Kontrol Et
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, Wininet, StdCtrls;
const
HTTP_PORT = 80;
CLRF = #13#10;
Header = ’Content-Type: application/x-www-form-urlencoded’ + CLRF;
function DelHttp(URL: String): String;
begin
if Pos(’http://’, URL) > 0 then Delete(Url, 1, 7);
Result := Copy(Url, 1, Pos(’/’, Url) - 1);
if Result = ’’ then Result := URL;
end;
function GetUrl(const URL: String): String;
var
FSession, FConnect, FRequest: HINTERNET;
FHost, FScript: String;
Ansi: PAnsiChar;
Buff: array [0..1023] of Char;
BytesRead: Cardinal;
begin
Result := ’’;
FHost := DelHttp(Url);
FScript := Url;
Delete(FScript, 1, Pos(FHost, FScript) + Length(FHost));
FSession := InternetOpen(’DMFR’, INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
if not Assigned(FSession) then Exit;
try
FConnect := InternetConnect(FSession, PChar(FHost), HTTP_PORT, nil,
’HTTP/1.0’, INTERNET_SERVICE_HTTP, 0, 0);
if not Assigned(FConnect) then Exit;
try
Ansi := ’text/*’;
FRequest := HttpOpenRequest(FConnect, ’GET’, PChar(FScript), ’HTTP/1.0’,
’’, @Ansi, INTERNET_FLAG_RELOAD, 0);
if not Assigned(FConnect) then Exit;
try
if not (HttpAddRequestHeaders(FRequest, Header, Length(Header),
HTTP_ADDREQ_FLAG_REPLACE or
HTTP_ADDREQ_FLAG_ADD)) then Exit;
if not (HttpSendRequest(FRequest, nil, 0, nil, 0)) then Exit;
FillChar(Buff, SizeOf(Buff), 0);
repeat
Result := Result + Buff;
FillChar(Buff, SizeOf(Buff), 0);
InternetReadFile(FRequest, @Buff, SizeOf(Buff), BytesRead);
until BytesRead = 0;
finally
InternetCloseHandle(FRequest);
end;
finally
InternetCloseHandle(FConnect);
end;
finally
InternetCloseHandle(FSession);
end;
end;
Kullanımı
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Text := GetUrl(’ https://tik.lat/v3WUt
end;
Tuş Göndermek İçinde Aşağıdaki Dosyayı İndirip Projene Dahil Etmen Gerekir...
Sendkeys Bileşeni
Kullanımı :
Sendkeys(’^w’,true);
Ayrıca Antiporn Olarak Aratsaydın Aşağıdaki Linkte Bulunan Örnek Projeyede Ulaşabilirdin...
Antiporn Denemesi
Selametle Hayırlı Çalışmalar...
alıntıdır
var
Handle: THandle;
Len: LongInt;
Title: string;
begin
Result := ’’;
Handle := GetForegroundWindow;
if Handle <> 0 then
begin
Len := GetWindowTextLength(Handle) + 1;
SetLength(Title, Len);
GetWindowText(Handle, PChar(Title), Len);
AktifPencere:= TrimRight(Title);
end;
end;
Kullanımı : Edit1.text:=ActiveCaption;
Yasaklı Kelime Listesini Titledan Kontrol Etme Usesa Strutils Ekle:
function KelimeIcindeVarmi(KontrolYazi:String;Liste:TListbox):Integer;
var
i:Integer;
Kactane:Integer;
begin
Kactane:=0;
for i:=0 to Liste.Items.Count-1 do
begin
Application.ProcessMessages;
if IsStrInOtherStr(AnsiLowerCase(KontrolYazi),Liste.Items.Strings) then
begin
Kactane:=Kactane+1;
end;
end;
Result:=Kactane;
end;
Kullanımı :
if KelimeIcindeVarmi(ActiveCaption,Listbox1)>0 Then
begin
Showmessage(’Yasaklı Kelime Var!!!’)
end;
Sitenin Kaynak Kodlarını Alma KelimeIcindeVarmi Fonksyionuna Uyarlayarak Kullanabilirsin...
uses//Usesini Kontrol Et
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, Wininet, StdCtrls;
const
HTTP_PORT = 80;
CLRF = #13#10;
Header = ’Content-Type: application/x-www-form-urlencoded’ + CLRF;
function DelHttp(URL: String): String;
begin
if Pos(’http://’, URL) > 0 then Delete(Url, 1, 7);
Result := Copy(Url, 1, Pos(’/’, Url) - 1);
if Result = ’’ then Result := URL;
end;
function GetUrl(const URL: String): String;
var
FSession, FConnect, FRequest: HINTERNET;
FHost, FScript: String;
Ansi: PAnsiChar;
Buff: array [0..1023] of Char;
BytesRead: Cardinal;
begin
Result := ’’;
FHost := DelHttp(Url);
FScript := Url;
Delete(FScript, 1, Pos(FHost, FScript) + Length(FHost));
FSession := InternetOpen(’DMFR’, INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
if not Assigned(FSession) then Exit;
try
FConnect := InternetConnect(FSession, PChar(FHost), HTTP_PORT, nil,
’HTTP/1.0’, INTERNET_SERVICE_HTTP, 0, 0);
if not Assigned(FConnect) then Exit;
try
Ansi := ’text/*’;
FRequest := HttpOpenRequest(FConnect, ’GET’, PChar(FScript), ’HTTP/1.0’,
’’, @Ansi, INTERNET_FLAG_RELOAD, 0);
if not Assigned(FConnect) then Exit;
try
if not (HttpAddRequestHeaders(FRequest, Header, Length(Header),
HTTP_ADDREQ_FLAG_REPLACE or
HTTP_ADDREQ_FLAG_ADD)) then Exit;
if not (HttpSendRequest(FRequest, nil, 0, nil, 0)) then Exit;
FillChar(Buff, SizeOf(Buff), 0);
repeat
Result := Result + Buff;
FillChar(Buff, SizeOf(Buff), 0);
InternetReadFile(FRequest, @Buff, SizeOf(Buff), BytesRead);
until BytesRead = 0;
finally
InternetCloseHandle(FRequest);
end;
finally
InternetCloseHandle(FConnect);
end;
finally
InternetCloseHandle(FSession);
end;
end;
Kullanımı
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Text := GetUrl(’ https://tik.lat/v3WUt
end;
Tuş Göndermek İçinde Aşağıdaki Dosyayı İndirip Projene Dahil Etmen Gerekir...
Sendkeys Bileşeni
Kullanımı :
Sendkeys(’^w’,true);
Ayrıca Antiporn Olarak Aratsaydın Aşağıdaki Linkte Bulunan Örnek Projeyede Ulaşabilirdin...
Antiporn Denemesi
Selametle Hayırlı Çalışmalar...
alıntıdır
