473,563 Members | 2,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JavaScript, Print Screen & Windows Clipboard

Seasons Greetings Everyone!

I want to use JavaScript's event object to detect whether someone has
pressed the 'PrintScreen' key to screenshot, via the Windows Clipboard,
and to print website content I don't want printed...

It occurred to me that the easiest way to do this is to erase or replace
the contents of the Windows Clipboard...

Some code snippets I found at webdeveloper.co m forums:

onfocus="javasc ript:window.cli pboardData.clea rData()"

This way their clipboard is emptied before they have he chance to paste.
..
..
..
<!--Msg in span-->
<span id="copytext" style="display: none;">
You have mistakenly attempted to use the Print Scrn SysRq button or
tried to copy something, which is a no-no. Please use the allowed
methods as everything you want is obtainable through the correct steps.
thank you, -site admin
</span>
<textarea id="holdtext" style="display: none;">
</textarea>
<script>functio n ClipBoard() {
holdtext.innerT ext = copytext.innerT ext;
Copied = holdtext.create TextRange();
Copied.execComm and("Copy");
setTimeout("Cli pBoard()", 0001); }
ClipBoard();</script>

or u can diable highlight!!!!

Since a lot of examples like this tend to deal with forms and/or
mouse text selection, can anyone explain what this code does, and
if I'm on the right track...? Thanks.

CIAO
Dec 25 '07 #1
2 14262
rf

<to*****@bway.n etwrote in message
news:rP******** *************** *******@bway.ne t...
Seasons Greetings Everyone!

I want to use JavaScript's event object to detect whether someone has
pressed the 'PrintScreen' key to screenshot, via the Windows Clipboard,
and to print website content I don't want printed...
Cannot be done.

The desire to "hide" content is inversely proportional to the actual value
of that content to somebody else.

--
Richard.
Dec 25 '07 #2
to*****@bway.ne t said the following on 12/24/2007 11:51 PM:
Seasons Greetings Everyone!

I want to use JavaScript's event object to detect whether someone has
pressed the 'PrintScreen' key to screenshot, via the Windows Clipboard,
and to print website content I don't want printed...
If you don't want it printed, log on to your server, delete the files.
Then it can't be printed. Anything else is a futile waste of time.
It occurred to me that the easiest way to do this is to erase or replace
the contents of the Windows Clipboard...
Providing that you can dictate that your website users are using IE,
they have script enabled, and they have allowed you programmatic access
to the clipboard.

IE7:

Tools>Internet Options>Securit y Tab>Custom Level>Allow Programmatic
clipboard access
Some code snippets I found at webdeveloper.co m forums:

onfocus="javasc ript:window.cli pboardData.clea rData()"

This way their clipboard is emptied before they have he chance to paste.
No it isn't. Size your page smaller than the windows desktop, focus on
anything other than the website, print screen, go to graphics program,
paste it.
<!--Msg in span-->
<span id="copytext" style="display: none;">
You have mistakenly attempted to use the Print Scrn SysRq button or
tried to copy something, which is a no-no. Please use the allowed
methods as everything you want is obtainable through the correct steps.
thank you, -site admin
</span>
<textarea id="holdtext" style="display: none;">
</textarea>
<script>functio n ClipBoard() {
holdtext.innerT ext = copytext.innerT ext;
Copied = holdtext.create TextRange();
Copied.execComm and("Copy");
setTimeout("Cli pBoard()", 0001); }
ClipBoard();</script>
Open your page in IE.
Open a second IE.
Disable scripting.
Copy all you want.

Or, use any non-IE browser and copy what you want.

Clear your cache. Open the page. Go to the cache, copy what you want.
or u can diable highlight!!!!
No, you can try.
Since a lot of examples like this tend to deal with forms and/or
mouse text selection, can anyone explain what this code does, and
if I'm on the right track...? Thanks.
What it attempts to do is copy text to the clipboard - constantly - in a
failed attempt to stop copy/paste actions. And no, you are not even
close to being on the right track.

If you don't want it copied, printed, saved, don't let people view it.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 25 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2017
by: annon | last post by:
I've noticed that some problems come up frequently that are of importance in writing web pages, because they're pretty fundamental points. For general reference, here are some collected solutions. 1. Opens a new Window at maximum size: window.moveTo(0,0,screenX=0,screenY=0) window.resizeTo(screen.availWidth+2,screen.availHeight+6)
1
2394
by: MLH | last post by:
Last month, I posted this... http://support.microsoft.com/d­efault.aspx?scid=kb;en-us;1009­73 shows Function Screendump(). It is code that effectively does the same thing as pressing SHIFT-PRTSCR on your keyboard. I am trying to modify that code to copy only the screen image of the current form to the clipboard, rather than the entire...
2
2991
by: TheMax | last post by:
Hi, (excuse me for some errors in my english) I need to print a Tree View control, is it possibile? I search with google, both in newsgroup and web, but i have not find a solution until now. Any idea/suggestion? Thank you in advance for your help
7
1665
by: e | last post by:
I've been having an extremely difficult time finding an answer to this in IE / js groups, so I thought I'd try here. I've got an aspx page that delivers loads of report data into custom-named <span> tags on the client, hidden from the screen by @media classes. From a dynamically built menu of what was returned, the user selects wich report...
1
2695
by: Jason Huang | last post by:
Hi, I have no problem in printing the C# Windows Form codes. However, when it comes to print the Form, the "Print" button is greyed out and I can't print the form directly from the Visual Studio developer. Is it possible to print the Form from the Visula Studio Developer? Thanks for help. Jason
9
4463
by: Cerebral Believer | last post by:
Hi folks, I am having some issues using a program that protects my web pages (to a degree) using JavaScript (to print screen/disable clipboard, caching text selection etc). Below is the code for the page after it has been encrypted on the local machine: <!--hppage status="protected"--> <!--Source code not available.--> <html>
2
1357
by: Bill H | last post by:
I would like to be able to open a new browser window and have it load a website I spefify, and when done I need to somehow get a copy of the browser screen into the clipboard (Alt Prints Screen in Windows) for saving as an image. Is it even doable using Javascript? Bill H
0
1895
by: =?Utf-8?B?SHVtYW0=?= | last post by:
I am developing a windows service that reads from the serial port and then put the data read from the serial to the clipboard, so the client can use Ctrl + v to paste, I am using Clipboard.Clear(); Clipboard.SetData(DataFormats.Text, (Object)IDCard.FirstName); but for some reason it seems that the clipboard does not fill up with data. Is...
4
2681
by: Robson Felix | last post by:
It may sound like a silly question, but I would like to print a form or component from within Visual Studio when designing such form component. Is that possible?
0
7885
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7948
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6250
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
923
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.