clipboard

Getting selected item in active window

谁都会走 提交于 2019-12-13 12:18:52
问题 I am using C# to develop an application that works with the clipboard, an was wondering if its possible to get the contents of what the user has selected in the current window, no matter what window it is (e.g. could be FireFox, notepad, etc.). 回答1: I'm not sure if you're going to be able to get a general solution for this problem. Take a look at this link; http://www.eggheadcafe.com/software/aspnet/33899121/get-selected-text-of-active-window-.aspx The author of this post reports that their

Get the selected text content from other programs

懵懂的女人 提交于 2019-12-13 08:58:57
问题 When I am using other programs (e.g. opening a pdf or word), I will select some text contents (like a word or paragraph) by using the mouse. I want my python program to get this text content. How to do this using PyQt, or some other Python library? 回答1: This is an easy task, you haven't specified the pyqt version, so I'll post the solution for PyQt4, here you go: from PyQt4.QtCore import QObject, pyqtSlot, SIGNAL, SLOT from PyQt4.QtGui import QApplication, QMessageBox import sys class

Get Clipboard owners Title/Caption

怎甘沉沦 提交于 2019-12-13 07:40:34
问题 I am working on a project which will not allow users to copy text from few of the external websites, I was able to setup a ClipboarViewer and it is interrupting the clipboard, now I am trying to get the owner of the clipboard and then the title/caption of the windows, below is what I have tried but it always returns empty protected override void WndProc(ref Message m) { switch ((User32.Message) m.Msg) { case User32.Message.WM_DRAWCLIPBOARD: { ClipboardChanged(); User32.SendMessage(

Firefox Xul Clipboad

為{幸葍}努か 提交于 2019-12-13 05:05:25
问题 I'm new to the programming world & i'm trying to develop an extension for Firefox. I have a Xul window with a textbox and i would like to copy the entire textbox and put in to the clipboard of firefox and paste it anywhere on the firefox browser. Help me out with some JS code or using xul coding. Please help me out or give me some suggestion. Thanking you guys in advance. 回答1: For copying text to the clipboard the easiest way is to use the clipboard helper service. 回答2: My Problem is Fixed :

Limit on text data size in clipboard?

蓝咒 提交于 2019-12-13 03:57:52
问题 ** ADDENDUM: After some serious hours of research i found that i was barking up the wrong tree. The problem was not the clipboard itself but what happens if you feed it malformed unicode text which i apparently did. My editor had no problem handling it but when the clipboard got it it was truncated at the point where the error was in the text. Reading 'damaged' file content will have the same effect when strings are handled in the application later and i therefore now use the Encoder

ASP.NET MVC Paste to clipboard

让人想犯罪 __ 提交于 2019-12-13 02:25:04
问题 I have a ASP.NET MVC 4 app. I want to copy a text(from PDF) CTRL+C and paste it as parameter in a method from a controller. My webgrid has column with an ActionLink grid.Column(" ", " ", format: @<a href="@Url.Action("Clipboard", "People", new { cbdata = window.clipboardData.getData('Text') })">Clipboard</a>), ... [HttpPost] public ActionResult Clipboard(string cbdata) // is string ok ? { //I'm doing something with my clipboard data .. return View(); } This part is not working : window

Copy text from a hidden control using JavaScript

烈酒焚心 提交于 2019-12-13 01:17:51
问题 I want to be able to place text in a textarea, and copy it to the clipboard, without displaying the textarea. To copy the text to the clipboard, I create a button with onclick = "document.getElementById('txtData').select(); document.execCommand('copy');" and this works fine. However, if I try to hide the textarea using either strStyle = 'display:none;' strStyle = 'visibility:hidden;' as per If I want my textarea to be hidden, how do I do it? then the copy no longer works. The textarea is

Excel.Range.Copy() paste with Clipboard.GetText()

扶醉桌前 提交于 2019-12-13 00:17:56
问题 I have this little piece of C# code in which I'm trying to loop through Worksheets inside an Excel file, copy the UsedRange to the Clipboard and paste it into a text file . The code I have so far appears to work without throwing any errors, but for some reason nothing at all gets written into my text file. Am I missing something? And if I include the System.Reflection.Missing.Value as a parameter for the Copy method, still nothing happens. Here's my code: using (StreamWriter sw = File

XCode 4.3 Text from clipboard automatically in TextView by entering

依然范特西╮ 提交于 2019-12-12 19:08:53
问题 I don't find some information about the clipboard on the iPhone simulator and iPhone devices... I have a textView and when I entered the textView I want see the text which is in clipboard. I hope that somebody can help me. Best Regards John 回答1: perhaps look at UIPasteboard Class Reference 来源: https://stackoverflow.com/questions/10364142/xcode-4-3-text-from-clipboard-automatically-in-textview-by-entering

How to paste from system clipboard content to an arbitrary window using Java

纵然是瞬间 提交于 2019-12-12 18:08:09
问题 I would like to write a Java program that has a button. When the button is pressed it pastes / drops the content of the system clipboard to the text field that currently has focus within an arbitrary, possibly non-Java app (say MS Word). Essentially the button action has to simulate the sending of CTRL-V (paste) action somehow. Does any one have any suggestions? 回答1: The package java.awt.datatransfer seems to be a solution, according to this article. Here is another article. From the latter