Get window using process Thread.
C#
4
Posts
4
Posters
0
Views
1
Watching
-
You can use this to get an instance to the current thread:
Thread _currentThread = Thread.CurrentThread
Cheer's, Alex Manolescu
-
Are you looking for the main form in your own application ? A main window in a different application? Is the other process a .NET application? Please explain
-
I assume that you want to get the window handle from a thread id. To do that, I would:
- Pass the thread id to GetProcessIdOfThread() to obtain a process id
- Because a process can open multiple windows, you need to return a collection. Iterate every window, getting their process ids. If it matches the id from 1., then add the window handle to the collection
OSDev :)