Sas
Sas

Reputation: 2503

How to get copied text from memory without pasting?

I got one requirement which is when the user copy any text the system should get the copied text from the memory into the program without require the user to paste it in a txtbox or similar control. I searched on the internet but I didn't get any information. can somebody suggest or provide some references so that I can follow...????

any help would be highly appreciated...!!!!

Upvotes: 1

Views: 692

Answers (3)

Alexei Levenkov
Alexei Levenkov

Reputation: 100545

As it is already pointed out accessing clipboard is either not possible or restricted for security reasons for all components running on a page in a browser (restricted == is unlikely to be enabled by anyone, especially for such "spy on clipboard" purpose).

For standalone application you can either scan clipboard all the time or use clipboard filters.

Native functions are around SetClipboardViewer and GetClipboardData.

Managed: Clipboard.

Upvotes: 1

Gabe
Gabe

Reputation: 50503

From a web development standpoint, you can not access the clipboard directly. You will have to create either a Flash or Silverlight hook into the clipboard to get the data.

Example

Another Example

Upvotes: 3

SLaks
SLaks

Reputation: 887797

For security reasons, you will never be able to do that in Javascript.

Upvotes: 2

Related Questions