You probably know all this already and forgive me if so but normally a central server manages the clients and connections; it's IP could be distributed with the clients and they then connect to the server rather than each other.
In a pure peer-to-peer network, which is what your serverless chat is, the clients (or, more correctly, peers) don't know who to connect to. So how do they discover each other? The obvious way is for peers to broadcast UDP packets (sent to 255.255.255.255), and listen for these from other peers. A list of IP's discovered can be maintained, and the user can then initiate direct TCP connections (on a different port) to one or more of these.
Here are some snags:
* UDP is a 'fire and forget' protocol- you don't how far your packet got.
* UDP broadcasts are normally blocked by firewalls, unless you explicitly open up the port for UDP (not recommended for security).
The good news is, the basic mechanism of text chat using the Winsock control is fairly easy.