隨著網絡的普及
廢話不多說了
unit Unit
interface
uses
Windows
Dialogs
type
TForm
Timer
Label
PopupMenu
Exit: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure Timer
procedure Label
Y: Integer);
procedure Label
Shift: TShiftState; X
procedure ExitClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form
oldx
oldIp: string;
implementation
{$R *
//下面就是關鍵所在了
function LIP : string;
type
TaPInAddr = array [
PaPInAddr = ^TaPInAddr;
var
phe : PHostEnt;
pptr : PaPInAddr;
Buffer : array [
I : Integer;
GInitData : TWSADATA;
begin
WSAStartup($
Result :=
GetHostName(Buffer
phe :=GetHostByName(buffer);
if phe = nil then Exit;
pptr := PaPInAddr(Phe^
I :=
while pptr^[I] <> nil do begin
result:=StrPas(inet_ntoa(pptr^[I]^));
Inc(I);
end;
WSACleanup;
end;
procedure TForm
begin
with Label
begin
Caption:=
Font
Font
Font
Font
Align:=alClient;
PopupMenu:=popupmenu
end;
Timer
Timer
Label
oldIp:=LIP;
BorderStyle:=bsNone;
Alphablend:=true; //呵呵
Alphablendvalue:=
FormStyle:=fsStayOnTop; //讓窗體總在最前面
end;
procedure TForm
begin
Label
if oldip <> LIP then
Showmessage(
end;
procedure TForm
Y: Integer);
begin
if ssleft in shift then //移動窗體Form
begin
Form
Form
end;
end;
procedure TForm
Shift: TShiftState; X
begin
oldx:=x;
oldy:=y;
end;
procedure TForm
begin
Close;
end;
end
程序比較簡單
本程序在Delphi
From:http://tw.wingwit.com/Article/program/Delphi/201311/24998.html