Andrei
Andrei

Reputation: 17

How to disable print screen in windows app

I am developing an UWP app and I need to disable any method of print screening the app (print screen, snipping tool etc).

How can I do this? Anything from temporarily disabling the app when in focus or just print screening with a black screen works(right now when i alt tab the app goes black).

I tried catching the event but for some reason the print screen key isn't handled the same as the rest.

Upvotes: 0

Views: 1068

Answers (1)

Luandersonn Airton
Luandersonn Airton

Reputation: 43

Set IsScreenCaptureEnabled property of the ApplicationView class to false

ApplicationView view = ApplicationView.GetForCurrentView(); view.IsScreenCaptureEnabled = false;

from MSDN:

ApplicationView.IsScreenCaptureEnabled Property

This property lets you protect against unwanted copies of the window. When screen capture is disabled for a window, the window appears black in images produced by screen capture operations. For an example of setting the isScreenCaptureEnabled property, see the Disable screen capture sample.

Upvotes: 1

Related Questions