What is the best (easiest) way to take a screenshot of an running application with C++ under Windows?
Press the Windows key + PrintScreen on your keyboard (or, PrtSc). Screenshots are automatically saved to Pictures/Screenshots in your user directory (C:/Users/%username%/Pictures/Screenshots by default).
Screenshots showing only one screen:Hit CTRL + ALT + PrtScn on your keyboard. Hit CTRL + V to paste the screenshot in Word, Paint, an email, or whatever else you can paste it into.
Save full screen screenshot: Windows Key + PrtScn (or Windows Key + Volume Down on a tablet) Copy screenshot of single window: Alt + PrtScn.
You have to get the device context of the window (GetWindowDC()
) and copy image (BitBlt()
) from it. Depending on what else you know about the application you will use different methods to find which window's handle to pass into GetWindowDC()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With