clipboard

Clipboard behaves differently in .NET 3.5 and 4, but why?

本小妞迷上赌 提交于 2019-12-03 10:47:50
问题 We recently upgraded a very large project from .NET framework 3.5 to 4, and initially everything seemed to work the same. But now bugs have started to appear on copy paste operations. I have managed to make a small reproducible app, which shows the different behavior in .NET 3.5 and 4. I have also found a workaround (manually serialize the data to the clipboard), but I'm left with a need to know "why" there is a difference in behavior. This is the small test app I made: using System; using

WPF DataGrid, Copy to Clipboard after Ctrl+C,OnCopyingRowClipboardContent

蹲街弑〆低调 提交于 2019-12-03 10:41:08
For WPF, Data Grid I am trying to copy to clipboard my custom text data, after Ctrl+C Diverse attempts to use override OnCopyingRowClipboardContent(DataGridRowClipboardEventArgs args) or CopingRowClipboardContent event , don't help. Either clipboard gets empty or standard row text, but not what I would like to put there. For instance protected override void OnCopyingRowClipboardContent(DataGridRowClipboardEventArgs args) { Clipboard.SetText("Abc-hello"); bool b1 = Clipboard.ContainsText(); string s1 = Clipboard.GetText(); } s1 gets desired text, but after going out of this method clipboard

Why is writing to the clipboard in JS considered a security hole?

安稳与你 提交于 2019-12-03 10:38:17
It seems there is currently no pure JavaScript method for accessing the system clipboard using most modern browsers, Internet Explorer being an exception. On numerous other Stack Overflow questions (e.g., Clipboard access using Javascript - sans Flash? ) it's explained that this limitation is a deliberate security measure to protect against web sites reading passwords or other sensitive data from the clipboard. While it seems obvious that reading from the clipboard would be a huge security risk, it's not clear to me why writing to the clipboard would be. What scenario, if any, are browsers

How to get HTML data out of of the OS X pasteboard / clipboard?

纵然是瞬间 提交于 2019-12-03 09:32:54
问题 I do have to send a report regarding pasting some clipboard content into a web rich editor and I need a way to dump/restore the clipboard content to (probably) HTML. How can I do this? It seems that pbcopy / pbpaste do alway give me text even if I use the pbpaste -P rtf or pbpaste -P HTML 回答1: Three years later, in more civilized times, we have Swift. You can write a short Swift script to pull exactly what you need off of OS X's pasteboard. Put the following Swift 4 snippet into a new text

What do various clipboard/drag-and-drop formats mean?

こ雲淡風輕ζ 提交于 2019-12-03 08:50:07
I was playing around with drag and drop. I made a sample application and dropped a file from folder My Music onto my application. Here's what e.Data.GetFormats() returned: Shell IDList Array UsingDefaultDragImage DragImageBits DragContext DragSourceHelperFlags InShellDragLoop FileDrop FileNameW FileName IsShowingLayered DragWindow IsComputingImage DropDescription DisableDragText ComputedDragImage IsShowingText What do each of these mean and how to decode and use them? Googling each of them didn't yield any useful information. FileDrop is standard, covered by the DataFormats class. Shell IDList

Copy to clipboard with jQuery/js in Chrome

邮差的信 提交于 2019-12-03 08:11:12
问题 I know this kind of question has been asked here for many times, including: How do I copy to the clipboard in JavaScript? or How to copy text to the client's clipboard using jQuery?, I'm narrowing the scope: Condition: works fine in Google Chrome (would be nice if cross-browser, but not necessary) with no flash Is there such a solution or workaround? 回答1: You can use either document.execCommand('copy') or addEventListener('copy') , or a combination of both. 1. copy selection on custom event

How to save PngImage from clipboard

て烟熏妆下的殇ゞ 提交于 2019-12-03 07:57:35
How can i save the pngimage to file copied form AdobeFirewoks(Clipboard) or Photoshop without losing the transparency. i am using delphi2009. thank you in advance. @TLama I tried this code but there is no transparency. I don't know also if i do it right. png := TPngimage.Create; try png.LoadFromClipboardFormat(CF_BITMAP, Clipboard.GetAsHandle(CF_BITMAP), CF_BITMAP); image1.Picture.Assign(png); finally png.Free; end; Based on empirical results confirmed by my colleague having Adobe Photoshop CS 6 13.0 x32 using the following test code points out that it's not possible to save the image from

How to get a clipboard paste notification and provide my own data?

随声附和 提交于 2019-12-03 07:40:03
问题 For a small utility I am writing (.NET, C#), I want to monitor clipboard copy operations and clipboard paste operations. My idea is to provide my own data when pasting into an arbitrary application. The monitoring of a copy operation can be easily done by using a clipboard viewer. Something that seems much more advanced to me is to write a "clipboard paste provider": Answer to "what formats are available" queries of applications. Supply data to application paste operations. I found this

How can I listen for clipboard events in node.js?

别说谁变了你拦得住时间么 提交于 2019-12-03 07:29:11
I want to be able to listen for clipboard events (the copy event more precisely) in node.js. I've already used windows keyboard hooks in java... so I'm already a bit familiar with the topic. And as I'm using Ubuntu 10.10 as my main OS, I'm most interested in a Ubuntu Desktop solution. (but I'd still love to know how to accomplish this for a Windows system too) Any thoughts? Thanks a lot in advance, Jochen I suggest you look at the node-clipboard module and continually listen for changes to the clipboard using callbacks. Something like: var clipboard = "" function listenClipboard(){ var new

Vim: Use + as default register only for yank command

我与影子孤独终老i 提交于 2019-12-03 07:24:00
I'd like to use + register (system clipboard) only for yank command (that is, don't overwrite this register on dd or other commands). :set clipboard+=unnamed won't work, because it introduces dd overwriting described above. You can overwrite the default yank commands so that they default to the system clipboard, unless another register is explicitly given: :nnoremap <expr> y (v:register ==# '"' ? '"+' : '') . 'y' :nnoremap <expr> yy (v:register ==# '"' ? '"+' : '') . 'yy' :nnoremap <expr> Y (v:register ==# '"' ? '"+' : '') . 'Y' :xnoremap <expr> y (v:register ==# '"' ? '"+' : '') . 'y'