Accessing a Running Instance of a Window

  • Thread starter Thread starter Marc W.
  • Start date Start date
M

Marc W.

Hello again,

Is there any way to access the open instance of a window? For example, is
there any list of open windows in the current exe that Windows keeps track
of and that I can access?

My problem is that I need to be able to access the values of controls from
an external class, and I can't seem to figure out how to gain access to
these (public) controls without creating a new instance of the window in
code, which of course wouldn't work.

Thanks!
- Marc W.
 
Marc,

If there is a .NET representation of a window, then you can probably use
the static FromHandle method on the Control class to get the .NET
representation of it. Of course, you need the handle of the window.

If you need some other identifier to access the window, then you will
have to come up with this mechanism yourself.

Hope this helps.
 
Back
Top