Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<b>Trap "PrintScreen" button</b>

Status
Not open for further replies.

arunglobal

Programmer
Sep 8, 2003
40
IN
Hi Pals,

I am n need to Block Print screen button in my web application client side (ASP.Net)

iam using the below script to Block CTRL keys.but unable to trap "Print Scrn"

/*Controls the CTRL keys*/
function keyWhat(e)
{
if (window.event.ctrlKey)
{
window.event.cancelBubble = true;
window.event.returnValue = false;
return false;
}
}
document.onkeydown=keyWhat;

Innovative ideas arfe welcome...
Tq n Advance
 
You cannot do this client-side with JavaScript. You can detect it with the following code, but you cannot block it:

Code:
document.onkeyup = function(eventData) {
	eventData = (eventData) ? eventData : event;
	if (eventData.keyCode == 44) {
		// do stuff here
	}
}

Hope this helps,
Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Hi TQ
My ultimate aim is to STOP taking screen shots of my web application.(ASP.Net)

If we do some stuff in code behind then SCREEN SHOTS are possible while the page is in OFFLINE (Offline content).

Any Idea
 
You're wasting your time. If you block PrtSc and someone wants a screen shot anyway, there are dozen of screen capture programs that will let you define virtually any key combination to activate them. You can't block ALL keystrokes.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 

Absolutely. Give up now - you will NOT be able to stop people from stealing graphics from your website.

Even professional solutions that claim to do this cannot stop all ways.

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Hi Pals,

Tq for the Nce replies and Suggestions.

But my Web Application is not a Commercial one.
This is Particularly for Internal offcial purpose of Confidential things.(act like a Intranet application)

so no screen capturing software can bee installed in the machines (Office machines).

So now its required to stop taking print screens by the employees on the confidential datas...

any suggestions plz
 
You have now been told twice that what you are wanting to do is not possible via JavaScript.

The only way you will be able to stop Print Screen is with a "real" application.

To reiterate: YOU WILL NOT BE ABLE TO DO THIS WITH JAVASCRIPT. GIVE UP TRYING NOW.

Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top