Tech Support > Microsoft Windows > Development Resources > How to implement a "resident" application
How to implement a "resident" application
Posted by sasha.sirotkin@gmail.com on May 7th, 2008


What would be the best way to implement an application that is running
all the time, does not have a visible window (maybe an icon on the
system tray), is invoked by pressing special keyboard-mouse sequence
and when invoked, looks at the selected text in a currently active
window and displays a tool tip based on this text. Something similar
to a dictionary I guess, from the UI point of view.

I did not code for Win32 for many years and would greatly appreciate
some tips about what technologies, APIs, etc to use and what should be
the general architecture of such an application. If anybody has
stumbled upon any relevant source code samples - even better.

Thanks.

Posted by paul on May 7th, 2008


sasha.sirotkin@gmail.com wrote:
Simply a GUI win32 app without window (default) with a hotkey.

Posted by sasha.sirotkin@gmail.com on May 7th, 2008


On May 7, 5:06 pm, paul <p...@lisp.com> wrote:
OK, but how can I access the selected text from the active window ?

Posted by Sebastian G. on May 7th, 2008


sasha.sirotkin@gmail.com wrote:


Sending a WM_GETTEXT message? D'Oh, please learn the basics first!

Posted by Christian ASTOR on May 7th, 2008


sasha.sirotkin@gmail.com wrote:
It depends on the window class.
e.g. for Office, you can use IAccessible interface.
Then you call AccessibleObjectFromWindow() & OBJID_NATIVEOM
to get the IDispatch interface and access object model to get the
selected text.

Posted by Scott Seligman on May 7th, 2008


seppi@seppig.de wrote:
WM_GETTEXT will not return just the selected text.

As another poster suggested, it depends on the window you're trying to
get the text from.

--
--------- Scott Seligman <scott at <firstname> and michelle dot net> ---------
I'm the one that has to die when it's time for me to die, so let me
live my life, the way I want to.
-- Jimi Hendrix