clipboard

How to preserve the contents of the clipboard

▼魔方 西西 提交于 2019-12-05 14:13:53
Is there a way to preserve the contents of the clipboard? I tried the following code but it doesn't work. Dim iData As IDataObject = Clipboard.GetDataObject() ...(use clipboard) Clipboard.SetDataObject(iData) Thank you. The easiest way to preserve the contents of the clipboard is to leave the clipboard alone. The clipboard is meant as a temporary storage area for the user , not for applications, so likely what you are trying to do has better solutions than to clobber the clipboard. You can use the OpenClipboard and CloseClipboard. According to MSDN opening the clipboard will keep other

How to copy text to clipboard from a Google Chrome extension?

拈花ヽ惹草 提交于 2019-12-05 13:34:22
I found that there's an experimental clipboard class. But it works only in dev channel, right? Any idea how I can copy the text? Athena In your content script, have this: // step 1: get the text you mean to copy // (actual implementation not included) // step 2: send it to your background page chrome.extension.sendRequest({ text: "text you want to copy" }); In your background page, have this: // step 3: set up your background page HTML // and <html> <head> <script type="text/javascript"> chrome.extension.onRequest.addListener(function (msg, sender, sendResponse) { var textarea = document

Jupyter Notebook: How to copy paste image into MS word?

不打扰是莪最后的温柔 提交于 2019-12-05 13:06:05
I tried to copy the image and paste them into MS word, but it didn't work. I'm not sure if this is my problem, or the word's problem? The images are at: https://cdn.rawgit.com/cqcn1991/Wind-Speed-Analysis/master/output_HTML/marham.html#5.3-Sectoral-Comaprison The paste result (in MS Word), it's done by CTRL+C, CTRL+V: I can only paste the text, not the image. I experiment it with Medium and another web app. Medium works exactly like MS Word, while another is able to paste. I think the underlying problem may be that the image in Jupyter Notebook is too deep in divs? so it get escaped in Word?

Copying an image to the clipboard from command line

孤者浪人 提交于 2019-12-05 12:14:49
I am using ImageMagick to copy a portion of my screen into a temporary file (something.png). I would now like to paste the contents of this file into the clipboard directly from command line. So far my script looks like this: #!/bin/bash TMPFILE=$(mktemp) FORMAT='.PNG' SCREENSHOT_FILE=${TMPFILE}${FORMAT} mv "$TMPFILE" "$SCREENSHOT_FILE" import "$SCREENSHOT_FILE" cat "$SCREENSHOT_FILE" | parcellite rm "$SCREENSHOT_FILE" Parcellite works perfectly for command line copying and pasting, but I can’t get it to work with image. I reckon this is not a feature of parcellite. How could I do that then ?

Show contents of the Windows clipboard

こ雲淡風輕ζ 提交于 2019-12-05 11:06:44
问题 How can I see what the Windows clipboard currently contains without using the paste operation? I don't want the "pasted-to" application to perform any actions on the clipboard (for example, formatting text and converting). Is there a tool which shows the clipboard's objects and their format (CF_BITMAP, CF_TEXT, etc.) and content (in simple bytes for example)? 回答1: There is a list of clipboard manager tools at Wikipedia: Clipboard manager ClipX allows you to view a log of previous clipboard

Copy email to the clipboard with Outlook VBA

て烟熏妆下的殇ゞ 提交于 2019-12-05 08:10:51
How do I copy an email to the clipboard and then paste it into excel with the tables intact? I am using Outlook 2007 and I want to do the equivalent of "Click on email > Select All > Copy > Switch to Excel > Select Cell > Paste". I have the Excel Object Model pretty well figured out, but have no experience in Outlook other than the following code. Dim mapi As NameSpace Dim msg As Outlook.MailItem Set mapi = Outlook.Application.GetNamespace("MAPI") Set msg = mapi.Folders.Item(1).Folders.Item("Posteingang").Folders.Item(1).Folders.Item(7).Items.Item(526) I must admit I use this in Outlook 2003,

Clear Clipboard on SGS2 (api 10)

本小妞迷上赌 提交于 2019-12-05 08:10:29
I'm using a Samsung Galaxy S2 and tried the following: import android.text.ClipboardManager; ClipboardManager clipboard = (ClipboardManager)context.getSystemService(Context.CLIPBOARD_SERVICE); clipboard.setText(null); and clipboard.setText(""); It didn't work. Ideas? Their is a bug with the Samsung Galaxy. It doesn't accept setting the clipboard to a blank value. You could try setting it to a space instead. clipboard.setText(" "); For further information check this Have you tried .setPrimaryClip(ClipData clip)? The documentation reads: public void setPrimaryClip (ClipData clip) Since: API

Copy text from WPF DataGrid to Clipboard to Excel

℡╲_俬逩灬. 提交于 2019-12-05 07:59:05
I have WPF DataGrid (VS2010 C#). I copied the data from DataGrid to Clipboard and write it to an Excel file. Below is my code. dataGrid1.SelectAllCells(); dataGrid1.ClipboardCopyMode = DataGridClipboardCopyMode.IncludeHeader; ApplicationCommands.Copy.Execute(null, dataGrid1); dataGrid1.UnselectAllCells(); string path1 = "C:\\test.xls"; string result1 = (string)Clipboard.GetData(DataFormats.CommaSeparatedValue); Clipboard.Clear(); System.IO.StreamWriter file1 = new System.IO.StreamWriter(path1); file1.WriteLine(result1); file1.Close(); Everything works out OK except when I open the excel file

Copy to clipboard with no Flash - Firefox, Chrome, Safari, Opera [duplicate]

拈花ヽ惹草 提交于 2019-12-05 07:45:29
This question already has answers here : Closed 7 years ago . Possible Duplicate: Copy to clipboard without Flash I want to copy some text from an element by a given id to clipboard. I want to be flashless solution, no Flash at all. It can be in jQuery or JavaScript. The solution for IE is simple (clipboardData), but for FF, Chrome and others - it doesn't work. Help. There is no javascript method to do this - its prevented by browser security ... Flash is the best alternative ... Explanation of security policy on Firefox -> http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard

How to get correctly-encoded HTML from the clipboard?

点点圈 提交于 2019-12-05 06:07:01
Has anyone noticed that if you retrieve HTML from the clipboard, it gets the encoding wrong and injects weird characters? For example, executing a command like this: string s = (string) Clipboard.GetData(DataFormats.Html) Results in stuff like: <FONT size=-2>Â Â <A href="/advanced_search?hl=en">Advanced Search</A><BR>Â Â <A href="/preferences?hl=en">Preferences</A><BR>Â Â <A href="/language_tools?hl=en">Language Tools</A></FONT> Not sure how MarkDown will process this, but there are weird characters in the resulting markup above. It appears that the bug is with the .NET framework. What do you