how to disable “PRINT SCREEN” button while running my Application in WPF?

前端 未结 8 1928
滥情空心
滥情空心 2020-12-19 03:36

How can I disable Print Screen functionality while my WPF application is running?

The use-case is that my client wants to avoid unnecessary replication of valuable p

相关标签:
8条回答
  • 2020-12-19 04:08

    Basically you can hook to the ClipBoard events and then set the image copied to null if someone does it. So they can copy the image but it will be reset:

    Have a look at this:

    Clipboard event C#

    Alternatively in a timer, check the content of the clip board and clear it as soon as it is set to a picture.

    0 讨论(0)
  • 2020-12-19 04:09

    Easy:

    Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().IsScreenCaptureEnabled = false;
    
    0 讨论(0)
  • 2020-12-19 04:13

    Simply speaking, you cannot. "Print screen" just copies the pixels on the screen to the clipboard, and is not part of your application.

    0 讨论(0)
  • 2020-12-19 04:13

    No, No way to do that. Even if you capture the Print Screen key in your application user might set focus to some other application and then do the Print screen(having your application on side etc.).

    Only way would be to create a dummy application in background which captures all keystrokes using Keyboard Hooks and filters Print Screen, but that will happen for all applications not just yours. And moreover as George said user can use cellphone camera too!

    0 讨论(0)
  • 2020-12-19 04:15

    The only way I can think of is to use the native Windows API (SetWindowsHookEx) to catch all keystrokes and filter out the PrintScreen key. However this would involve creating a native (i.e. unmanaged) DLL to actually do the keystroke processing.

    0 讨论(0)
  • 2020-12-19 04:16

    I think Microsoft Rights Management System can help. Give it a try. Following is the link:

    Microsoft Rights Management System

    0 讨论(0)
提交回复
热议问题