Re: Getting selected text from last active program
From: Thomas Matthews (Thomas_MatthewsSpitsOnSpamBots_at_sbcglobal.net)
Date: Thu, 11 Dec 2003 17:41:05 GMT
Niklas A wrote:
> In programs like WordFinder you can select a text in any program and
> then just press the shortcut and they will automaticly get the
> selected text and display the translation for you.
> The same thing happens in Google Deskbar. You select a text and you
> press a key kombination and it will automaticly search for that text
> with Google.
> But I've been wondering how you do this in a programming language like
> c or c++. I've been thinking about trying to get a handle to the last
> active window and then somehow get the selected text from there.
> I've tried to search for information on the Internet but all I get is
> how to select text or get selected text in the same program which is
> not what I want.
In Standard C and C++, your input facilities are text streams and
the parameters passed to the main() function. The output facilities
are text streams and the value returned from the main() function.
Anything else depends on the platform.
Some platforms provide "clipboards" for passing data between
programs. Others use sockets and pipes. Some even have memory
areas reserved for passing data between applications.
You will have to explore the facilities that are available on
your target platform(s).
-- Thomas Matthews C++ newsgroup welcome message: http://www.slack.net/~shiva/welcome.txt C++ Faq: http://www.parashift.com/c++-faq-lite C Faq: http://www.eskimo.com/~scs/c-faq/top.html alt.comp.lang.learn.c-c++ faq: http://www.raos.demon.uk/acllc-c++/faq.html Other sites: http://www.josuttis.com -- C++ STL Library book