Window title for a console application

Posted by Timbo on Stack Overflow See other posts from Stack Overflow or by Timbo
Published on 2010-04-24T02:06:12Z Indexed on 2010/04/24 2:13 UTC
Read the original article Hit count: 314

In Visual Studio's Attach to Process dialog, one of the columns in the Available Processes list is "Title", which lists the title of the topmost window owned by each process.

We spawn multiple instances of several server processes in order to compartmentalize the work. For these console processes, the Title field is blank, so currently we have to look up the process id in our management tool in order to find the correct process.

In order to streamline the debugging process, I would love to be able to use the Title field to directly determine which process I want.

SetConsoleTitle does not do the trick, nor SetWindowText with a NULL hWnd. To the best of my knowledge, a console application does not intrinsically own any window handles that we could pass to SetWindowText. We don't want to create any visible windows for these server processes.

Any suggestions for a reasonable way to trick Visual Studio into displaying some useful information here?

© Stack Overflow or respective owner

Related posts about console

Related posts about title