This isn't something that C++ covers by itself. So, you'll have to
use some operating system dependent method. Here's a link
which could be helpful to you if you're on Windows machines:
http://msdn.microsoft.com/library/de...onbyhandle.asp

If you're on a unix machine, sadly, I don't know the answer.

--Paul