clipboard

Yank entire file

▼魔方 西西 提交于 2019-11-26 18:46:11
问题 I often write something in gVim, then need to copy-paste it into another application. Is there an easy way to yank the entire file? I usually do something like this g g V G " + y (Go to top, visual-line mode, go to bottom, yank) But is there a better way that I'm missing out on? 回答1: I use the following instruction: :%y+ 回答2: ggyG (go to the first line, yank to the last line) Edit: Ah, system clipboard. Doesn't exactly roll off the fingers, but: gg"+yG 回答3: A working solution in old vi is :r

How to copy to clipboard using Access/VBA?

送分小仙女□ 提交于 2019-11-26 18:44:54
Using VBA inside Access2003/2007. How to copy the contents of a string variable to the clipboard? This site recommends a creating a zero length TextBox, copying the string to the TextBox, then running DoCmd.RunCommand acCmdCopy . Ugh. I mean, we may go down the route. But still. Ugh. While the MS knowledgebase article shows us how to do it but it involves a number of Windows API calls. Yuk. Are those the only two options? VB 6 provides a Clipboard object that makes all of this extremely simple and convenient, but unfortunately that's not available from VBA. If it were me, I'd go the API route.

How can I copy the output of a command directly into my clipboard?

穿精又带淫゛_ 提交于 2019-11-26 18:44:43
问题 How can I pipe the output of a command into my clipboard and paste it back when using a terminal? For instance: cat file | clipboard 回答1: I always wanted to do this and found a nice and easy way of doing it. I wrote down the complete procedure just in case anyone else needs it. First install a 16 kB program called xclip : sudo apt-get install xclip You can then pipe the output into xclip to be copied into the clipboard: cat file | xclip To paste the text you just copied, you shall use: xclip

GetClipboardData(CF_TEXT)

爷,独闯天下 提交于 2019-11-26 18:25:15
问题 How to use GetClipboardData(CF_TEXT); without calling and use process id of this in C++? and which libary does GetClipboardData(CF_TEXT) belong to? 回答1: GetClipboardData() is a Win32 API function. The handle returned by GetClipboardData() must be first locked with GlobalLock() , then you can retrieve the char* pointer of the ANSI text in the clipboard (note that if you want to retrieve Unicode text, you should use the CF_UNICODETEXT format). A sample code to retrieve the text from the

How can I use Clipboard in vbscript? [duplicate]

南笙酒味 提交于 2019-11-26 18:25:01
问题 This question already has answers here : Use clipboard from VBScript (15 answers) How to copy/cut a file (not the contents) to the clipboard in Windows on the command line? (6 answers) Closed 8 months ago . Editor's note : While this question is specifically about copying a file reference to the clipboard, its generic title led to answers about how to copy / get text . As an Emacs user on Windows who often attaches files in mails, I have been looking for a utility to copy a file ( not its

OpenClipboard failed when copy pasting data from WPF DataGrid

夙愿已清 提交于 2019-11-26 18:07:34
问题 I've got a WPF application using datagrid. The application worked fine until I installed Visual Studio 2012 and Blend+SketchFlow preview. Now, when I'm trying to copy the data from the grid into the clipboard with Ctrl + C (in any application), I'm getting the following exception: System.Runtime.InteropServices.COMException (0x800401D0): OpenClipboard Failed (Exception from HRESULT: 0x800401D0 (CLIPBRD_E_CANT_OPEN)) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32

Get text from clipboard using GetText - avoid error on empty clipboard

那年仲夏 提交于 2019-11-26 17:45:46
I'm using code like this to get text from off the Clipboard. Dim DataObj As New MSForms.DataObject DataObj.GetFromClipboard myString = DataObj.GetText I use error handling to get the past the case where the Clipboard is empty, and everything is fine as long as I keep Error Trapping set to Break on Unhandled Errors. However, for unrelated reasons I want to set Error Trapping to Break on All Errors, and this throws an error at DataObj.GetText when it finds the empty Clipboard. Is there any kind of test I can apply further upstream to avoid trying to process an empty Clipboard? Does this help?

Is it possible to read the clipboard in Firefox, Safari and Chrome using Javascript?

自作多情 提交于 2019-11-26 17:31:57
I'm trying to read the contents of the clipboard using Javascript. With Internet Explorer it's possible using the function window.clipboardData.getData("Text") Is there a similar way of reading the clipboard in Firefox, Safari and Chrome? Safari supports reading the clipboard during onpaste events: Information You want to do something like: someDomNode.onpaste = function(e) { var paste = e.clipboardData && e.clipboardData.getData ? e.clipboardData.getData('text/plain') : // Standard window.clipboardData && window.clipboardData.getData ? window.clipboardData.getData('Text') : // MS false; if

Copy selected text to the clipboard WITHOUT using flash - must be cross-browser

て烟熏妆下的殇ゞ 提交于 2019-11-26 17:31:13
I want to have a button which selects the text in a textarea and copies it to the clipboard. I can't seem to find any solutions which work in all browsers and don't use flash. Surely this is doable? I've seen it all over the place but I guess they use flash, which I really want to stay away from if possible as some people don't have it. This is what I have so far - it just selects the text: function copyCode() { $("#output-code").focus(); $("#output-code").select(); } (The focus is not strictly necessary) arcs execCommand('copy') There is a very new option. It is cross-browser but it will take

How do you copy/paste from the clipboard in C++?

浪子不回头ぞ 提交于 2019-11-26 16:35:36
问题 I'm still a C++ newbie who has only recently learned some file manipulation. I looked it up online and the codes given are way beyond my current skill. Is there a simple way to do this, or are there any good tutorials that can explain this from the very basics? 回答1: In windows look at the following API: OpenClipBoard EmptyClipboard SetClipboardData CloseClipboard GetClipboardData An extensive discussion can be found here. Obviously this topic is strongly operating system related. And if you