Kind of a special case problem:
System.Diagnostics.Process.Start(..)
I need to get the process's UI (or UI handle) at this point. Assume I cannot change the behavior of the process to make this any easier (or saner).
I have looked around online but I'll admit I didn't look for more than an hour. Seemed like it should be somewhat trivial :-(
C# is a programming language, . NET is a blanket term that tends to cover both the . NET Framework (an application framework library) and the Common Language Runtime which is the runtime in which . NET assemblies are run.
The popularity of C# is due to several reasons. The main one (as I mentioned before) is the community of developers and support for C# and the . NET framework in general. Being open-source makes it very easy to collaborate with other contributing developers.
. NET (pronounced dot net) is a framework that provides a programming guidelines that can be used to develop a wide range of applications–––from web to mobile to Windows-based applications. The . NET framework can work with several programming languages such as C#, VB.NET, C++ and F#.
There's no such thing as "C++.NET". There's C++/CLI, which is basically C++ with Microsoft extensions that allow you to write code targeting the . NET framework. C++/CLI code compiles to CLR bytecode, and runs on a virtual machine just like C#.
If you don't mind using the Windows API, you could use EnumWindowsProc
, and check each of the handles that that turns up using GetWindowThreadProcessId
(to see that it's in your process), and then maybe IsWindowVisible
, GetWindowCaption
and GetWindowTextLength
to determine which hWnd
in your process is the one you want.
Though if you haven't used those functions before that approach will be a real pain, so hopefully there's a simpler way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With