The Task Manager in Windows XP/Vista can be used to show the PID of a process…
From within the Task Manager, click on the “Processes” tab, then select the “View” menu and pick the “Select Columns” option.
The PID can be used in conjunction with the netstat command to find out which process runs on a given port:
netstat -aon | find “1234″ will show which PID is associated with port 1234, then use the Task Manager to lookup the process associated with that PID.