The process depends upon your soundcard. If you have one of those gaming cards that uses the Windows mixer, you have to navigate to the mixerr's Recording section and activate the appropriate source, which is generally called something like 'what you hear.' If you have a soundcard with its own software mixer, you must set-up the mixer according to the appropriate manufacturer's instructions. In the recording program you must choose the mixer's output as the program's input source.
There are also some inexpensive programs to do this for you virtually automatically. Here is one
http://www.highcriteria.com/