To know the ports being used ..
Type "netstat -a -n -o" in command prompt.
This will give you complete list of listening ports and established connections with IP and Process IDs
Then you can use "tasklist" command to know which process ID belongs to which process.
Alternatively you can use a very useful GUI for the same : TCPView
Also ..
There is no way you can stop an application from using a particular port. A few applications do offer you options to change port numbers being used .. but not all.
What you can do is that you can block ports ... ie stop any application from using a particular port (or range of ports) to connect to internet/network. In simple words .. use a Firewall.
Zone Alarm is the best in my view .. there are others too.
-----
alibi