Sign in to follow this  

[.net] Multiple Processes and Hidden Windows

This topic is 3096 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm trying to write a little C# program which opens up multiple command line applications. The application I am trying to run uses the window title/caption to update its progress (as a percentage). I'm currently just using multiple instances of Process to do this. I want to open up around 8 of these applications all running simultaneously with all the windows hidden. I then want to be able to pull the captions/text from each individual window and use them to update a progress bar on a windows form or whatever. The problems is that I am unable to pull the window title from the windows when they are hidden. Would this even be possible at all with a changing window title/caption on a hidden window? I've tried GetWindowText() and using the Process.MainWindowTitle but they aren't returning anything. Hope that makes sense. Thanks.

Share this post


Link to post
Share on other sites
In unmanaged code you can get the title of a hidden console window by calling AttachConsole() on the console window's process id followed by GetConsoleTitle() and FreeConsole(). I don't know if AttachConsole()/FreeConsole() have .NET equivalents, but P/Invoking them shouldn't be a problem since they have very simple function signatures. Reading from Console.Title should be the equivalent of calling GetConsoleTitle(). Also, I believe this technique only works on XP and later.

Share this post


Link to post
Share on other sites

This topic is 3096 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this