A
A
Artem2018-04-09 15:36:49
C++ / C#
Artem, 2018-04-09 15:36:49

How to get text from someone else's window using WinAPI in c#?

Hello!
In general, there is a certain "foreign" process that periodically "disappears" (ceases to perform its functions) due to the fact that it loses contact with its own licensing server. At the same time, the process does not crash, but only in the service window (in the label in the status bar, as I understand it), the text changes from conditionally [ok] to conditionally [not ok]. The only way to deal with this ailment is to restart the process until the connection to the licensing service is restored and the inscription in this label becomes [ok]. Of course, I want to restart it automatically upon receiving the [not ok] signal, because during the downtime of this process, users suffer and money is lost.
Tell me, please, how can I find the identifier of this label in a foreign window using WinAPI in c# and get its text?
I don’t know what the process is written on, but it’s definitely a Windows application)
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Infarh, 2018-04-09
@Infarh

Once upon a time, I faced a similar problem (management of "foreign" windows). As a result, the Window class and the whole WindowsAPI project were born.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question