问题
When you choose Debug / Attach to Process in Visual Studio, the dialog displayed has a "Title" column. By default this shows the caption of the main window belonging to the process. For example, it might display "It was a dark and stormy night - Notepad".
How can I set this field for an application that doesn't have a main window (e.g. a Windows service)?
I have multiple services running with the same executable name, and I'd like to be able to easily differentiate between them when attaching.
回答1:
Put this in a batch file and it will tell you the identity of the worker process:
c:\windows\system32\inetsrv\appcmd list wp
pause
This doesn't give you a title but will identify them when attaching
来源:https://stackoverflow.com/questions/5326046/setting-the-title-value-displayed-in-visual-studios-attach-to-process-dialo