We work on several different branches of the same code, and when working on two branches at once, it can become confusing and time wasting.
Presently, the VS title bar has the text <solution-name> - Visual Studio
.
Is it possible for me to write an extension that will make that text <solution-name>: <branch-name> - <Visual Studio>
?
To be honest, I am not sure I am understanding your question correctly, but I had asked one here on SO that seems to be about a similar problem:
Working with different versions/branches of the same Visual Studio 2005 solution
Just another extension to change the Visual Studio titlebar by defining it as an expression: http://visualstudiogallery.msdn.microsoft.com/2e8ebfe4-023f-4c4d-9b7a-d05bbc5cb239
The setup that makes use of a "title expression" makes this plugin quite flexible.
Check out latest release of VSCommands 2010 Lite. It introduced a feature called Friendly Solution Name where you can set up a regex pattern to extract branch name from folder structure and have it placed in Visual Studio main window title. More details: http://vscommands.com/releasenotes/3.6.8.0 and http://vscommands.com/releasenotes/3.6.9.0
MSDN Download Page
Trying to set MainWindow.Caption throws an exception. You have to use the Win32 SetWindowText function to change the title, but beware: Visual Studio resets the title bar text at the drop of a hat, so you should implement a Timer to keep setting your desired text. The following code from the
Connect
class of the add-in will permanently (or, as long as the add-in is running) keep the title bar text as "Hello World!"In the VS automation model there is
which you could start with.
See http://msdn.microsoft.com/en-us/library/envdte._dte.mainwindow.aspx
I just created a small Visual Studio extension that can help: http://visualstudiogallery.msdn.microsoft.com/f3f23845-5b1e-4811-882f-60b7181fa6d6
Official page here: http://erwinmayer.com/labs/visual-studio-2010-extension-rename-visual-studio-window-title/