473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

What should i do to copy the selected word to the clipboard when i double-click

I want to get the selected text(word) from any document(pdf,webpage,text etc) when i double-click on the word of that document.
My code is here:
Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Xml;
  10. using MouseKeyboardActivityMonitor.WinApi;
  11. using MouseKeyboardActivityMonitor;
  12.  
  13. namespace dictionar_demo_1
  14. {
  15.     public partial class MainForm : Form
  16.     {
  17.         private readonly KeyboardHookListener m_KeyboardHookManager;
  18.         private readonly MouseHookListener m_MouseHookManager;
  19.  
  20.         public MainForm()
  21.         {
  22.             InitializeComponent();
  23.             m_KeyboardHookManager = new KeyboardHookListener(new GlobalHooker());
  24.  
  25.             m_KeyboardHookManager.Enabled = true;
  26.  
  27.             m_MouseHookManager = new MouseHookListener(new GlobalHooker());
  28.             m_MouseHookManager.Enabled = true;
  29.  
  30.             m_KeyboardHookManager.KeyPress += HookManager_KeyPress;            
  31.         }
  32.  
  33.  
  34.         private void HookManager_KeyPress(object sender, KeyPressEventArgs e)
  35.         {
  36.             string x = string.Format("{0}", e.KeyChar);
  37.             if (x == "f")
  38.             {
  39.                 m_MouseHookManager.MouseDoubleClick += HookManager_MouseDoubleClick;         
  40.             }
  41.         }
  42.  
  43.  
  44.          private void HookManager_MouseDoubleClick(object sender, MouseEventArgs e)
  45.            {
  46.              Clipboard.Clear();
  47.  
  48.               // i want to copy the selected text 
  49.               //from any document(like pdf, .html ,txt)
  50.              // when i double-click a text
  51.  
  52.         }
  53.     }//form
  54. }
Now what should i do to the HookManager_MouseDoubleClick()?
I tried in many ways but i failed to do that.
Dec 5 '12 #1
0 1831

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: tabonni | last post by:
Hello All I am creating an ASP page. There are a list of filename and checkbox next to it. When user checked all the documents they want and click ADD TO CLIPBOARD button. All filepaths will be...
0
by: could ildg | last post by:
The paragraph is as below, I mark the word quiet with *** ***. ___________________________________ One problem with distributed applications is that if no data arrives over a long period of time,...
2
by: kris_scheyer | last post by:
Hi, I've searched dozens of forums and websites to find a way to have javascript copy an image I click on into the clipboard of windows. I found a few examples but I couldn't get any of them to...
2
by: RandyB | last post by:
I built a web app that creates and saves a WordML file on disk (with a processing instruction in it for Word.Document). When this file is requested from a client machines, the client's browser...
1
by: mohan21_kumar | last post by:
Hi, How to Save images in ms word file when it is downloaded from asp.net application. I have used the following code to convert the html page into ms word file. but i'm not able to save the...
0
by: dev121 | last post by:
Hi, I am currently trying to copy a single selected item from a listbox control in vba (excel). So far I have got this code, which doesn't work. <code> Private Sub btnAddNewOrder_Click()
8
by: ALTAFAD | last post by:
How to copy selected (s) textfield, which those selected through checkbox I like to copy in clipboard. Access textfield data when front of the textfield checkbox is checked if not checked it...
1
by: dphir | last post by:
Does Javascript have a function that can identify where the selected word exist? if i have HTML element that contains a number of words: <p>the harvest is **the** process of gathering mature...
0
by: dekk | last post by:
Overview - Subform called 'Time' - Subform fields are named: Well Ref - this is the well reference Start Time - self explanatory End Time - self explanatory Activity - combo box selection...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.