clipboard

Use clipboard from VBScript

亡梦爱人 提交于 2019-11-27 01:51:11
I am looking for a method to place some text onto the clipboard with VBScript . The VBScript in question will be deployed as part of our login script. I would like to avoid using anything that isn't available on a clean Windows XP system. Edit: In answer to the questions about what this is for. We wanted to encourage users inside our organization to use the file server to transfer documents instead of constantly sending attachments by email. One of the biggest barriers to this is that it isn't always obvious to people what the correct network path is to a file/folder. We developed a quick

Copy and Modify selected text in different application

孤街浪徒 提交于 2019-11-27 01:29:13
问题 I have a windows application running at the backend. I have functions in this applications mapped to hot keys. Like if I put a message box into this function and give hot key as Alt + Ctrl + D . then on pressing Alt , Ctrl and D together the message box comes up. My application is working fine till this point. Now I want to write a code inside this function so that when I am using another application like notepad, I select a particular line of text and press the hot key Alt + Ctrl + D it is

Copy text to clipboard from bookmarklet

天大地大妈咪最大 提交于 2019-11-27 01:23:10
问题 I'm trying to write a little bookmarklet that can extract some text from the active page and load that into the clipboard. The extraction is easy enough, but I'm really stuck doing the clipboard-copying part. Currently, I'm just alert ing the text and hitting Ctrl + C to copy the text from the message-box, which isn't ideal. I've read How to Copy to Clipboard in JavaScript and other questions that suggest I use zeroclipboard, but I have no idea how one would make that work from a bookmarklet

How do I copy the contents of a String to the clipboard in C#?

喜你入骨 提交于 2019-11-26 23:50:39
If I have some text in a String, how can I copy that to the clipboard so that the user can paste it into another window (for example, from my application to Notepad)? ravuya You can use System.Windows.Forms.Clipboard.SetText(...) . Jeff Moser System.Windows.Forms.Clipboard.SetText (Windows Forms) or System.Windows.Clipboard.SetText (WPF) Paul Alexander I wish calling SetText were that easy but there are quite a few gotchas that you have to deal with. You have to make sure that the thread you are calling it on is running in the STA. It can sometimes fail with an access denied error then work

How can I copy a string to the clipboard within my console application WITHOUT adding a reference to System.Windows.Forms?

拜拜、爱过 提交于 2019-11-26 22:48:00
问题 I have a .NET 4.0 console application that generates SQL and stores it in a string variable. I want this string to be copied directly to the clipboard. So far, all my research indicates that the ONLY way this can possibly be done is by adding a reference to System.Windows.Forms. I do not want to add a reference to an assembly that is irrelevant to a console application. Within the universe in which we currently exist, is there a known method of copying a string of text to the clipboard within

Can python send text to the Mac clipboard

喜你入骨 提交于 2019-11-26 22:40:04
问题 I'd like my python program to place some text in the Mac clipboard. Is this possible? 回答1: New answer: This page suggests: Implementation for All Mac OS X Versions The other Mac module (MacSharedClipboard.py, in Listing 4) implements the clipboard interface on top of two command-line programs called pbcopy (which copies text into the clipboard) and pbpaste (which pastes whatever text is in the clipboard). The prefix "pb" stands for "pasteboard," the Mac term for clipboard. Old answer:

javascript cut/copy/paste to clipboard: how did Google solve it?

别等时光非礼了梦想. 提交于 2019-11-26 22:36:10
问题 Yes, this question has been asked again and again: how to copy and paste from and to the system clipboard with javascript? I have found only partial solutions and hacks so far. The reason that it has been asked so often in the past is that there still is no working solution. However, I saw that Google Docs actually has a working solution now for both keyboard events as well as buttons. So, it is possible, but how do they do it? Software Salad article, Accessing the System Clipboard with

javascript copy rich text contents to clipboard

坚强是说给别人听的谎言 提交于 2019-11-26 22:23:27
Premise I need help copying rich text to the clipboard using JavaScript. I have searched around and haven't found anything to suit my specific needs. Code function ctrlA1(corp) { with(corp) {} if (document.all) { txt = corp.createTextRange() txt.execCommand("Copy") } else setTimeout("window.status=''", 5000) } <div id="sc1">hello <br> <b> world </b> </div> <button onclick="ctrlA1(document.getElementById('sc1') )"></button> Problem The aforementioned code isn't working and is resulting in an object expected error . Any help is appreciated! I have seen a library out there called zeroclipboard ,

Text erased from screenshot after using Clipboard.GetImage() on Windows 10?

久未见 提交于 2019-11-26 21:58:22
问题 This is a weird one: I recently upgraded my workstation from Windows 7 to Windows 10. I have a Chat client, that accepts Images from the clipboard using the Code below: if (Clipboard.ContainsImage()) { BitmapSource source = Clipboard.GetImage(); BitmapFrame frame = BitmapFrame.Create(source); var encoder = new System.Windows.Media.Imaging.PngBitmapEncoder(); encoder.Frames.Add(frame); var stream = new MemoryStream(); encoder.Save(stream); byte[] daten = stream.ToArray(); if (daten != null &&

Copy to Clipboard for all Browsers using javascript

会有一股神秘感。 提交于 2019-11-26 21:54:17
I was trying to make "Copy to Clipboard" work on all browsers but no luck. Am using javascript and I don't want to use Zero Clipboard to do. Please let us know what wrong in my code. Appreciate for your help. Below is the code (Currently my code is working only on IE browser):- <script type="text/javascript"> function copyToClipboard(s) { if( window.clipboardData && clipboardData.setData ) { clipboardData.setData("Text", s); } else { // You have to sign the code to enable this or allow the action in about:config by changing user_pref("signed.applets.codebase_principal_support", true); netscape