...check if Winsock is enabled?
|
Autor:
Mike Carey |
[ Print tip
] | | |
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;
|