clipboard

clipboard manager crash (only) on android 2.x

别来无恙 提交于 2019-12-12 09:27:21
问题 I just discovered that this code goes to crash my app only on android 2.x ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); clipboard.setText(textView1.getText()); I think... I need add check android version before run this method, which is correct code to permit runs also on android 2.x? Thanks! 回答1: Clipboard API has changed on level 11 of Android SDK. Here is some code to handle both versions from arinkverma. I hope this can get into support library one

java Clipboard error (bug)?

笑着哭i 提交于 2019-12-12 09:18:01
问题 I have a program, which opens a program, then it copies and pastes a string into the program and after some time it copies a string from the program to the clipboard using a robot with ctrl+c. Then my program checks if the copied string contains a word, but instead of inspecting the recently copied string it uses the previous copied string of the beginning. Heres some code: new ProcessBuilder("pathToProgram").start(); copy(STRING1); paste(); Thread.sleep(x); //Move mouse to a position //robot

Set clipboard to transparent image

南楼画角 提交于 2019-12-12 05:24:38
问题 I am creating a program that needs to copy an image to clipboard. The problem is that the image has a transparent background and, whenever I copy it, the image comes out with a black background instead of transparent. I tried lots of things since 2 days ago but none worked. The class imageSelection is based on http://www.java2s.com/Tutorial/Java/0120__Development/SettinganimageontheclipboardwithacustomTransferableobjecttoholdtheimage.htm package Package1; import java.awt.Image; import java

How to use SetClipboardViewer Function in Windows Service C#?

自闭症网瘾萝莉.ら 提交于 2019-12-12 05:15:17
问题 I am trying to get clipboard events using SetClipboardViewer. It works in a windows form when i override the function: protected override void WndProc(ref Message m) that belongs to the base class System.Windows.Forms. The problem is that i want to do it in a windows service. Does someone knows how to get the clipboard events in a windows service? Thanks. 回答1: Clipboard belongs to the session (actually the session's winstation), and there's no interactive user to do a clipboard copy in a

Clipboard viewer doesn't get paste notification

笑着哭i 提交于 2019-12-12 04:44:15
问题 I need to block pasting from the clipboard in the window of the certain program. I set a clipboard viewer in my program like this: HWND hwndNextViewer = 0; LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_CREATE: { hwndNextViewer = SetClipboardViewer(hWnd); break; } default: return DefWindowProcW(hWnd, message, wParam, lParam); } case WM_DRAWCLIPBOARD: { if(GetForegroundWindow() == hWndTarget){ OpenClipboard(hWndTarget);

Gtk+ Error when Copy / Paste performed outside of application

别说谁变了你拦得住时间么 提交于 2019-12-12 03:57:33
问题 I'm fairly new to Gtk. I'm working on a GUI application. Everything works great until I press Ctrl + C, Ctrl + V to copy/paste (in an outside application like excel). I am using Windows 8 64bit with a Mingw 32bit compiler. Any help on this issue would be appreciated. 回答1: I managed to hit the same assertion error by inducing infinite recursion (my trick was to call paste_clipboard() inside a paste_clipboard signal handler - fun fun!). Possibly you had something that responded to a clipboard

Excel copy from cell to clipboard

一笑奈何 提交于 2019-12-12 03:23:57
问题 In Excel 2013 into cell i post this string '<xml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' Then i copying this cell to clipboard using ctrl+c and post to notepad using ctrl+v I get this "<xml xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">' " So all my string became quoted and trimed first single quote, also added additional quotes to url, how to prevent changes and get string as it is. 回答1: Excel identifies the first ' as Symbol that the value in a cell is text. And

Copying an image from the clipboard

女生的网名这么多〃 提交于 2019-12-12 03:19:25
问题 I want to get an image which is copied from the galley to my app.Means the image will be there in the clipboard I want to get that image can anyone help me. I need to copy the image from the clipboard and I don't want it directly from the gallery. 回答1: I think this is as close as you're going to come to getting Gallery images into your app... http://eggie5.com/8-hook-share-picture-via-menu-android The article follows through all the way to an HTTP send of the image, but obviously you can just

How do I properly handle file copy/cut & paste in javafx?

僤鯓⒐⒋嵵緔 提交于 2019-12-12 02:27:18
问题 I'm working on a program in which I want to add the possibility of copy-pasting (or cut-pasting) files. I could create it so it only works within the program, but it would be nicer if I could use the system-wide clipboard. That has one huge problem though: when pasting I don't know if files are copied or cut from the system explorer, I only get the file locations. I am using Java and the javafx clipboard. Some sample code: Clipboard clipboard = Clipboard.getSystemClipboard(); List<File> files