From: sasha.sirotkin on
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.
From: paul on
sasha.sirotkin(a)gmail.com wrote:
> 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.

Simply a GUI win32 app without window (default) with a hotkey.
From: sasha.sirotkin on
On May 7, 5:06 pm, paul <p...(a)lisp.com> wrote:
> sasha.sirot...(a)gmail.com wrote:
> > 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.
>
> Simply a GUI win32 app without window (default) with a hotkey.

OK, but how can I access the selected text from the active window ?
From: Sebastian G. on
sasha.sirotkin(a)gmail.com wrote:

> On May 7, 5:06 pm, paul <p...(a)lisp.com> wrote:
>> sasha.sirot...(a)gmail.com wrote:
>>> 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.
>> Simply a GUI win32 app without window (default) with a hotkey.
>
> OK, but how can I access the selected text from the active window ?


Sending a WM_GETTEXT message? D'Oh, please learn the basics first!
From: Christian ASTOR on
sasha.sirotkin(a)gmail.com wrote:
> On May 7, 5:06 pm, paul <p...(a)lisp.com> wrote:
>>Simply a GUI win32 app without window (default) with a hotkey.
>
>
> OK, but how can I access the selected text from the active window ?

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.