I can give not a comp but a code do some trics
example 1 (opening internet address)
------------
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, SHDocVw;
type
TForm1 = class(TForm)
WebBrowser1: TWebBrowser;
Edit1: TEdit;
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
private
procedure go;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.go;
var
yontem: OleVariant;
begin
yontem := 0;
WebBrowser1.Navigate(WideString(edit1.Text),yontem,yontem,yontem,yontem);
end;
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if key = #13 then
go;
end;
end.
example 2 internet status
----------
uses wininet;
function UserOnline:boolean;
var
connect_status:dword;
begin
connect_status := 2 {lan} +
1 {modem} +
4 {proxy} ;
result := InternetGetConnectedState(@connect_status,0);
end;
if UserOnline = true then ShowMessage('Internet connection stat: Online')
else
ShowMessage('Internet connection stat: Offline');
example 3 (address verification)
---------
uses wininet;
function CheckUrl(url:string):boolean;
var
hSession, hfile, hRequest: hInternet;
dwindex,dwcodelen :dword;
dwcode:array[1..20] of char;
res : pchar;
begin
if pos('
then
url := '
Result := false;
hSession := InternetOpen('InetURL:/1.0',
INTERNET_OPEN_TYPE_PRECONFIG,nil, nil, 0);
if assigned(hsession) then
begin
hfile := InternetOpenUrl(
hsession,
pchar(url),
nil,
0,
INTERNET_FLAG_RELOAD,
0);
dwIndex := 0;
dwCodeLen := 10;
HttpQueryInfo(hfile, HTTP_QUERY_STATUS_CODE,
@dwcode, dwcodeLen, dwIndex);
res := pchar(@dwcode);
result:= (res ='200') or (res ='302');
if assigned(hfile) then
InternetCloseHandle(hfile);
InternetCloseHandle(hsession);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if CheckUrl(Edit1.Text) then
Label1.Caption := 'Valid'
else
Label1.Caption := 'Invalid'
end;
example 4
---------
uses Shellapi
ShellExecute(0, nil, '
nil, nil, SW_SHOWDEFAULT);