473,772 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

1 New Member
I want to get the selected text(word) from any document(pdf,we bpage,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_Mou seDoubleClick() ?
I tried in many ways but i failed to do that.
Dec 5 '12 #1
0 1837

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

Similar topics

5
4344
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 copied into clipboard and then they can right-click -> paste into MS Outlook as attachments. How can I use clipboardData.setData function to do that? I saw a lot of examples they are just copy and paste text.
0
1687
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, you need to wonder why. On one hand, it could be that the other program just hasn't had any information to send recently. On the other hand, the other program could have crashed. TCP handles this problem by allowing you to send an "Are you still...
2
18317
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 work either getting object doesnt support this method or other errors I don't understand. If anyone has any working code for this I'd be very thankful for it. And yes, I know this only works in IE and I'm assuming that the user
2
1877
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 automatically opens Word 2003 and views the XML in the Word application as a document, as its supposed to. However, on one machine, the XML text just opens in the IE window as straight XML text, totally ignoring the PI to treat as a Word document. ...
1
5518
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 images from html to doc file. Please suggest me how to save an image from a html to doc file. I have used the following Code to convert HTML into doc file: Response.Clear(); Response.Buffer = true; Response.ContentType =...
0
1893
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
6231
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 should not copy in clipboard. If text field has data like that altaf/ahmed mr one field checked goodguydude@thisandthatandtheother.com one field checked...
1
2025
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 crops from the fields</p> ideally i want to know the index of selected word, if i select **the** word in the double star(**).
0
1285
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 Quantity - integer value Another Field 1
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9911
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8934
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.