clipboard

Monitor clipboard in Mac OS

冷暖自知 提交于 2019-12-10 10:19:51
问题 I need to monitor clipboard events in my mac os app. I found a sample for a clipboard viewer and another question in stackoverflow asking for the same thing, but none of them has a solution on how to monitor the clipboard events. That is, immediately after the user hits command + c, I get an event notifying. I know that the functionality exists, as there is an app that uses this functionality Ideas? 回答1: I have written a clipboard listener [it will print every new text based information that

Read text from clipboard in Windows using ctypes

◇◆丶佛笑我妖孽 提交于 2019-12-10 10:11:30
问题 I'm trying to get the text stored in the clipboard by just using ctypes in Python 3.6 . I tested a lot of solutions I found on Stack and GitHub, but they only work for Python 2 to Python 3.4 . This is the code you'll find almost everywhere: from ctypes import * def get_clipboard_text(): text = "" if windll.user32.OpenClipboard(c_int(0)): h_clip_mem = windll.user32.GetClipboardData(1) windll.kernel32.GlobalLock.restype = c_char_p text = windll.kernel32.GlobalLock(c_int(h_clip_mem)) windll

How to use clipboard to copy data from Excel Sheet to DataTable?

五迷三道 提交于 2019-12-10 06:36:41
问题 I have a Winform project, created on Microsoft Framework 3.5. The users may have installed Windows 7 or Windows XP, and Office 2007 or above. I'm working on in a procedure to get the clipboard data and put in on a C# DataTable. I already created a method to get the raw data from the clipboard and upload it in a DataTable. But in some cases, the Excel data shows a value, but internally have another: I'm investigating a method to get the raw data from Excel: string XmlFmt = "XML Spreadsheet";

Copying an image to the clipboard from command line

陌路散爱 提交于 2019-12-10 06:03:47
问题 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

React Native - Listener for change in clipboard

拈花ヽ惹草 提交于 2019-12-09 20:29:49
问题 Is there a way to add a listener for a change in clipboard data in React Native? Basically depending on whether the user has copied something in their clipboard, regardless of whether inside the app or with the app in the background, I want to perform some methods. 回答1: React native does not provide you with a way to listen for such events, but you have two approaches: one that will partially work but is extremely simple and one that will be written as it should and work as it should as well,

Want to know Windows Clipboard Internals

♀尐吖头ヾ 提交于 2019-12-09 18:36:03
问题 I am interested in learning windows system internals and how things work. I am inclined towards learning system programming on windows. With that context, I am curious to know few things on how windows clipboard internally functions: What precisely happens when we select some text, image etc and press Ctrl + C ? What precisely happens when we we press Ctrl + V in different application? Where exactly the copied data resides? Does the copied data go into kernel mode memory - that is shared

Android how to get string from clipboard onPrimaryClipChanged?

核能气质少年 提交于 2019-12-09 17:27:44
问题 I'm trying to get text copied into the clipboard using the following listener: import android.content.ClipboardManager.OnPrimaryClipChangedListener; import com.orhanobut.logger.Logger; public class ClipboardListener implements OnPrimaryClipChangedListener { public void onPrimaryClipChanged() { // do something useful here with the clipboard // use getText() method Logger.d("Clipped"); } } The listener is initialized as follows: ClipboardManager clipBoard = (ClipboardManager)getSystemService

Office 2013 Excel .PutInClipboard is Different?

两盒软妹~` 提交于 2019-12-09 09:53:44
问题 I've used a routine for years to put a plain text string into the clipboard that I can paste into another program such as: targetData.SetText "This is a plain text string" targetData.PutInClipboard When I use this in Excel Office 2013 the data isn't in the clipboard and therefore I can't paste it. This never happened in prior versions. Under closer inspection I've found that the string does go to the clipboard but as "System String" but not as "Text" or "Unicode Text". BUT... about 10% of the

Copy R plot to clipboard with custom size

孤街醉人 提交于 2019-12-09 09:00:49
问题 Is there a way to get R / RStudio to copy a plot to the clipboard with a custom size? RStudio has this function, but you have to define the size everytime and there is some extra clicking which I am sure is avoidable. I tried my best with saving as jpeg or else with file="clipboard" and then - after plotting - dev.off() . No error messages, but also nothing in the clipboard. Here is an example: data(mtcars) jpeg(file = "clipboard",width = 800, height = 600, units = "px", pointsize = 12,

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

无人久伴 提交于 2019-12-09 08:14:06
问题 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();