...überprüfen ob Winsock verfügbar ist?
Autor: Mike Carey
uses
Winsock;
function WinsockEnabled: Boolean;
var
wsaData: TWSAData;
begin
Result := True;
case Winsock.WSAStartup($0101, wsaData) of
WSAEINVAL, WSASYSNOTREADY, WSAVERNOTSUPPORTED: Result := False;
else
Winsock.WSACleanup;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if WinsockEnabled then
ShowMessage('Winsock is enabled')
else
ShowMessage('Winsock is disabled');
end;
printed from
www.swissdelphicenter.ch
developers knowledge base