uses
WinSock,
WinInet;
procedure StatusCallback(hInet: HINTERNET; Context, Status: DWORD;
pInformation: Pointer; InfoLength: DWORD);
var
sa: TSockAddr;
iar: TInternetAsyncResult;
s:
String;
dw: DWORD;
begin
case Status
of
INTERNET_STATUS_CONNECTING_TO_SERVER,
INTERNET_STATUS_CONNECTED_TO_SERVER:
Move(pInformation^, sa, SizeOf(sa));
INTERNET_STATUS_REQUEST_COMPLETE,
INTERNET_STATUS_HANDLE_CREATED:
Move(pInformation^, iar, SizeOf(iar));
INTERNET_STATUS_REDIRECT,
// URL
INTERNET_STATUS_RESOLVING_NAME,
// HOSTNAME
INTERNET_STATUS_NAME_RESOLVED:
// HOSTNAME
s := PChar(pInformation);
INTERNET_STATUS_STATE_CHANGE,
INTERNET_STATUS_RESPONSE_RECEIVED,
INTERNET_STATUS_REQUEST_SENT:
dw := PDWORD(pInformation)^;
end;
end;