473,779 Members | 1,913 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Selecting text in another application and importing it into mine

Hi,

How can select a single word of text, in any application, e.g. Windows
Explorer, Internet Explorer etc. , without double clicking it and instead use
a combination of mouse and keyboard, for example Left Control key + Right
Mouse Button, and retrieve that word into my application.
The app Babylon does somthing similar to this, so I guess it's possible to
do it in c# too.
Any ideas?

Thanks,
Ben
Nov 21 '07 #1
4 2263
Hi Ben,

There it a straight way in doing this and i can tell you this
because i am writing a application that works similar. Hook
the Window with Windows API where your cursor is over,
hook into the Controls or Applications Message Queue or
hook into its window procedure and watch for messages
like EM_SETSEL, EM_GETSEL,WM_CO PY and messages
like that. You can set a systemwide keyboard hook with windows
hooking api like SetWindowsHookE x() and control your applications
behavior e.g. keybord shortcuts to copy the data you want and how
you will select the text in the control,...

You can do it like that or someone has a btter solution for this,...

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
ke*****@arcor.d e

Best Quote: "Ain't nobody a badass with a double dose
of rock salt...", Kill Bill Vol.2

Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
Sign my guestbook: http://entwicklung.junetz.de/guestbook/
-----------------------
"This reply is provided as is, without warranty express or implied."

Nov 21 '07 #2
I think that the point that has to be made here is that there is no one
single interface that allows you to do such a thing. At best, you can
develop a heuristic which guesses how to deal with certain applications.

The accessibility libraries are actually supposed to be pretty good for
accessing disparate applications for this kind of information, so you could
look there.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Kerem Gümrükcü" <ka*******@hotm ail.comwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Hi Ben,

There it a straight way in doing this and i can tell you this
because i am writing a application that works similar. Hook
the Window with Windows API where your cursor is over,
hook into the Controls or Applications Message Queue or
hook into its window procedure and watch for messages
like EM_SETSEL, EM_GETSEL,WM_CO PY and messages
like that. You can set a systemwide keyboard hook with windows
hooking api like SetWindowsHookE x() and control your applications
behavior e.g. keybord shortcuts to copy the data you want and how
you will select the text in the control,...

You can do it like that or someone has a btter solution for this,...

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
ke*****@arcor.d e

Best Quote: "Ain't nobody a badass with a double dose
of rock salt...", Kill Bill Vol.2

Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
Sign my guestbook: http://entwicklung.junetz.de/guestbook/
-----------------------
"This reply is provided as is, without warranty express or implied."

Nov 21 '07 #3
Yes, thats why i said "messages like that", since there is no
single interface for such a task. other applications work the
same way, most of them with a heurisitc behaviour or even
work with image recognition. a fellow developer once wrote
such a application, which involved extreme mathematical
calculation. thats why i say that he has become nuts today!

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
ke*****@arcor.d e

Best Quote: "Ain't nobody a badass with a double dose
of rock salt...", Kill Bill Vol.2

Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
Sign my guestbook: http://entwicklung.junetz.de/guestbook/
-----------------------
"This reply is provided as is, without warranty express or implied."
Nov 21 '07 #4
There are also applications like word, which expose an automation
interface as well... Then there are .NET applications which use windows
messages for the UI, and can expose information through remoting, WCF, etc,
etc.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Kerem Gümrükcü" <ka*******@hotm ail.comwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
Yes, thats why i said "messages like that", since there is no
single interface for such a task. other applications work the
same way, most of them with a heurisitc behaviour or even
work with image recognition. a fellow developer once wrote
such a application, which involved extreme mathematical
calculation. thats why i say that he has become nuts today!

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
ke*****@arcor.d e

Best Quote: "Ain't nobody a badass with a double dose
of rock salt...", Kill Bill Vol.2

Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
Sign my guestbook: http://entwicklung.junetz.de/guestbook/
-----------------------
"This reply is provided as is, without warranty express or implied."

Nov 21 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2902
by: Maurice Ling | last post by:
Hi, I'm a postgraduate and my project deals with a fair bit of text analysis. I'm looking for some libraries and tools that is geared towards text analysis (and text engineering). So far, the most comprehensive toolkit in python for my purpose is NLTK (natural language tool kit) by Edward Loper and Steven Bird, followed by mxTextTools. Are there any OSS tools out there that is more comprehensive than NLTK? In the Java world, there is...
4
10717
by: Rob | last post by:
Hey, I'm pretty new to MySQL and have a question. I've built a database locally and have inputed some information. I need to go back and update some records, specifically by taking long pieces of text and putting them into text fields. Cutting and pasting in the command prompt for windows isn't such a good idea. Is there a way to update an existing record by importing a text file into a text field?
3
5087
by: Wade G. Pemberton | last post by:
Help!: I use javascript to format repetitive data from a web page input FORM into a long string , and save it as lines of comma delimited data in a text file on a Unix server. The text file is meant to be downloaded to MS Excel on the users' computers. Several such files will be downloaded and appended into the Excel file. Problem: The text file looks good when viewed offline by any text reader, but Excel will not import it...
12
2891
by: expect | last post by:
What's the big deal with importing text files? I have a 70 MB file to import and it's been one problem after another. I used the copy command and it appears that it's just not possible. I finally massaged the file into a .sql file and ran that using \i db.sql but that failed too because I overlooked ' in names like D'Adario. The other problem I encountered was that a numeric field had to have data in it, pg would not default to the...
1
2803
by: D Mat | last post by:
Hi, I'm trying to get MS Access 2000 to automatically import a series of (~200) flat text, tab delimited, data files into a single Access table, with consistent fields and rows. The files have different, but somewhat logical naming structures (ex.Jun01.txt, Jun02.txt, Jul01.txt, etc...). Is there a relatively simple way to accomplish this, considering i'm new to Access. I was especially hoping to do this without having to manually...
6
1683
by: MLH | last post by:
SELECT Adresses.RawData FROM Adresses WHERE (((Adresses.RawData)=InStr(1,,Chr$(13)))); Its not doing the trick for me and I'm not sure why.
6
1225
by: JimO | last post by:
I have a namespace called utility that I compiled using the /t:library switch. It compiles fine. When I try to import it into a database interface namespace, I get an error on compilation that says it's undefined and then one that says the class has no public members or cannot be found. Thanks, Jim
11
2945
by: panic attack | last post by:
Hello everbody, Our system is using Sql Server 2000 on Windows XP / Windows 2000 We have a text file needs to be imported into Sql Server 2000 as a table. But we are facing a problem which is, Sql Server claims that it has a character size limit ( which is 8060 ) so it cant procceed the import operation if the text file has a record bigger then 8060. The records , in the text file, have a size bigger then 8060. So we wont be able to...
16
7249
by: Wayne | last post by:
I've read that one method of repairing a misbehaving database is to save all database objects as text and then rebuild them from the text files. I've used the following code posted by Lyle Fairfield to accomplish the first step: Private Sub SaveObjectsAsText() path = CurrentProject.path & "\ObjectsAsText\" SaveDataAccessPagesAsText SaveFormsAsText SaveReportsAsText
0
9474
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
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
10138
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
10074
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
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
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
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
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.