Board index » delphi » How to get selected text of another window

How to get selected text of another window

Hello,

I need to know how to get selected text of another application. This could
be done by using clipboard as well. I could succed to do it only from
notepad, but it doesn't work at other applications.

You may help me to say how to find the active control of a window as well.

Thanks in advance

 

Re:How to get selected text of another window


This is not an especific question. You can do it through an API or through
Ole automation.

Through an API the way is:
First: Get the handle of that window.
Second: Sure that window have a component to write the text... then you need
the handle of that component.
Third: Using SelStart and SelLength you can select exactly what you want.

Through OLE automation:
The situation is more complex... basically we need to know if "the window"
is Word or another program.

Be more specific, please.

"Momotaro" <murat...@mynet.com> escribi en el mensaje
news:3bcdb5f5_1@dnews...

Quote
> Hello,

> I need to know how to get selected text of another application. This could
> be done by using clipboard as well. I could succed to do it only from
> notepad, but it doesn't work at other applications.

> You may help me to say how to find the active control of a window as well.

> Thanks in advance

Other Threads