Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you prevent an individual window being captured by Print-Screen?

Tags:

windows

winapi

I noticed a few times than when I print-screen while Media Player is running, the content is replaced with a grey rectangle. I've no idea if it's deliberate due to DRM, or some technical issue, but it struck me that being able to deliberately block screen-capture might be a useful feature in some scenarios. I am not looking to fix the problem, but replicate it!

Is there some specific message each HWND gets for print-screen - does Windows do a special repaint or simply dump buffers to the clipboard?

I guess I'd prefer to focus this on Win32 specifically, but as long as it's Windows-related then fine.

like image 842
Mr. Boy Avatar asked Jun 11 '10 12:06

Mr. Boy


People also ask

How will you take only a part of a window using screenshot option?

Press Ctrl + PrtScn keys. The entire screen changes to gray including the open menu. Select Mode, or in earlier versions of Windows, select the arrow next to the New button. Select the kind of snip you want, and then select the area of the screen capture that you want to capture.

How do I control Screenshots?

This can include many word processors, image editing software and some email programs. Hold the "Control" key down while pressing the "V" key. This shortcut will automatically paste the image. You can now manipulate the screen shot as you would any other image file.

How do I Print Screen a specific window?

Copy only the image of the active window Click the window that you want to copy. Press ALT+PRINT SCREEN. Paste (CTRL+V) the image into an Office program or other application.


2 Answers

You can register a hotkey, using this method. Register the PrtScr key and your application will receive a message in your WndProc, WM_HOTKEY. Once you recieve that, you can do something to your form to blank out the display, or something else.

That hotkey method should work even if your form is minimised.

like image 168
Russ Clarke Avatar answered Oct 05 '22 22:10

Russ Clarke


You have to turn off 'Use overlays' to be able to take a screenshot.

Open Windows Media player. Select "Tools" -> "Options..." from the menu. Click on "Performance" tab. Click on "Advanced..." button. Uncheck "Use overlays" checkbox in the "Video Acceleration" group. Click on "OK" button. Click on "OK" button

like image 43
Uku Loskit Avatar answered Oct 05 '22 23:10

Uku Loskit