Print Screen Program

Lenovo / 42334dg
December 29, 2009 at 19:46:20
Specs: Windows 7, 2 GHz DualCore/ 2041 MB
Hi, I've made a program to handle the image created in the clipboard by the PrintScreen function in Windows(7). This works great on most occations but not always; In games like Counterstrike Source the program doesn't get the image it should. In the example provided, CSS, the program gets the loading screen shown when starting up the game.
Here is a link to the image the program gets
http://static.zooomr.com/images/356...
It was all I could find by a quick google search. It's basically the same as my computer, only difference is that I use fullscreen mode.
The program is written in C++ and uses the following code to get the image from the clipboard:

HBITMAP h;
OpenClipboard(NULL);
h = (HBITMAP)GetClipboardData(CF_BITMAP);
CloseClipboard();

When I try to manually insert the image provided by printscreen in the Paint program, I get the same image as my program. I've never had a problem with the printscreen function so I guess the problem lies with my program.
Any thoughts on this?

Live the life as you know it
/ Wille


See More: Print Screen Program

Report •

#1
January 1, 2010 at 08:59:15
Programs that use overlays or DirectX typically don't handle the Print Screen feature of Windows, so the first step should be to ensure the relevant data is even in the clipboard.

Alternatively, you could just bind a key to 'jpeg' or 'screenshot'.


Report •

#2
January 1, 2010 at 09:07:46
Okay, well thing, as I described above, I'm not sure the data gets into the clipboard and I believe this was the programs fault. I'm wondering why, and how I can fix it?

Live the life as you know it
/ Wille


Report •

#3
January 1, 2010 at 10:21:05
Your program isn't at fault; it's the nature of overlays and Windows. If you must grab the picture, I assume you must take it directly from the video card's primary buffer. There may be another option, but I haven't used DirectX or attempted to solve a similar problem before.

With Source games, I still say you should just bind a key to screenshot.


Report •

Related Solutions

#4
January 1, 2010 at 11:11:28
Okay, thanks. To grab a screendump directly from the video card I guess I would need a diffrent library included depending on which video card it is?

Live the life as you know it
/ Wille


Report •

#5
January 1, 2010 at 11:48:37
Presumably DirectDraw/Direct2D will allow you to get at the primary buffer, but I haven't researched it.

Report •

#6
January 2, 2010 at 17:22:01
Yeah I tried using SaveSurfaceToFile() in DirectX9 but I get the same loading image I got using the normal PrintScreen function. Any Ideas?

Live the life as you know it
/ Wille


Report •

Ask Question