To get a form from a process handler

Is there a way to get a form from a process handler? Something like that.

Form form = (Form)Form.FromHandle(_process.MainWindowHandle);

But that does not work.

+3
source share
2 answers

According to this post , which only works for window descriptors belonging to your process. You cannot use Form.FromHandleto get a form from any other process.

See also: How to use Control.FromHandle?

+2
source

This can be done from within the process. Trying to capture Formor Controlfrom another process will not work.

, Form? , .

+1

Source: https://habr.com/ru/post/1766434/


All Articles