tags:

views:

115

answers:

6

How will i disable Print Screen whil my WPF application is running...?

+1  A: 

Not possible, and even if it were possible, it would be easily circumvented by a cell phone camera. Many are in the megapixel resolution range, making it quite easy for someone to get the information they want.

George Stocker
A: 

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

MSalters
is there anyway to detect whether print screen button clicked from my app?
Kishore Kumar
Not reliably. Furthermore, as your later comment indicated, this would be a "security" mechanism. That is to say, the people pressing it **will** try to find ways around your protection. Starting out with something this unreliable just invites them to break the protection entirely.
MSalters
A: 

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 creting a native (i.e. unmanaged) DLL to actually do the keystroke processing.

Ferruccio
A: 

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:

http://stackoverflow.com/questions/621577/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.

Aliostad
But this can be defeated by a screenshot program that directly writes to file.
Hans Kesting
It can be defeated by much lower tech stuff anyway! The point was to disable the PrintScreen button which my solution does it although not directly.
Aliostad
A: 

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!

akjoshi
A: 

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

Microsoft Rights Management System

Pradeep
Nope. Unrelated server-side technology.
MSalters