I got few solutions to this. One of the best and safest solution is install Windows 98 or 95 version in your system, or best way go to any internet cafe (or friends house) tell him to give the computer having Windows 98 installed and take screenshots on it. Screenshots can be taken using “Print Screen” button which is present above the “Delete-End-Pageup” buttons or near the scroll lock.
There are few softwares which enable us to take screenshots of any programming languages, but here in Windows XP all such softwares get failed. so install older Window versions. We can say “Old is Gold”
updated: You can also a software/emulator named DosBox to take screenshots of your C++ Programms.