The simplest way is to use the Windows inet_addr function, which is part of the Windows Socket 2 implementation, as in this example:
function IsValidIPv4Address(AAddress: String): Boolean; begin Result:=inet_addr(PChar(AAddress))<>INADDR_NONE; end;
Source: www.guidogybels.net.