Procedure GeserPanel(NamaPanel : TPanel);
const
SC_DragMove = $F012; {a magic number }
begin
ReleaseCapture;
NamaPanel.Perform(WM_SysCommand, SC_DragMove, 0);
End;
Gunakan Uses Winsock;
function LocalIP: string;
type
TaPInAddr = array[0..10] of PInAddr;
PaPInAddr = ^TaPInAddr;
var
phe: PHostEnt;
pptr: PaPInAddr;
Buffer: array[0..63] of Char;
I: Integer;
GInitData: TWSAData;
begin
WSAStartup($101, GInitData);
Result := '';
GetHostName(Buffer, SizeOf(Buffer));
phe := GetHostByName(buffer);
if phe = nil then Exit;
pPtr := PaPInAddr(phe^.h_addr_list);
I := 0;
while pPtr^[I] <> nil do
begin
Result := inet_ntoa(pptr^[I]^);
Inc(I);
end;
WSACleanup;
end;
function GetNetUserName: string;
var
pcUser: PChar;
dwUSize: DWORD;
begin
dwUSize := 21; // user name can be up to 20 characters
GetMem(pcUser, dwUSize); // allocate memory for the string
try
if NO_ERROR = WNetGetUser(0, pcUser, dwUSize)
then Result := pcUser;
finally
FreeMem(pcUser);
end;
end;
Function getNetComputername : String;
Var
PcName: array[0..256] of Char;
dwUSize: DWORD;
Begin
dwUSize := 255;
if GetComputerName(PcName, dwUSize) Then
Begin
Result:=pcname;
end else
Begin
end;
end;