Click here to Skip to main content
15,888,461 members
Articles / Programming Languages / C++
Article

Maintaining Project MRU List in Visual Studio .NET 2003 in the "Start Page"

Rate me:
Please Sign up or sign in to vote.
4.50/5 (8 votes)
6 Jul 20042 min read 63.1K   13   9
A quick method for maintaining the Project MRU List in Visual Studio .NET 2003 as it is shown on its "Start Page".

Introduction

For a quick and easy method to maintain the Visual Studio .NET most recently used (MRU) project list, as it is shown via the "Start Page", simply do the following:

  • Important: For this to work, there can be no instances of Visual Studio .NET running.
  • Important: Modifying the registry can be dangerous. Always have a backup of your system registry before performing any major modifications. In this case, however, the modifications are extremely minor and thus have minimal risk.
  1. Launch REGEDIT.EXE.
  2. Navigate to the following:

    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\<your version>\ProjectMRUList

    For example, if you have Visual Studio .NET 2003 installed, the path would be:

    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.1\ProjectMRUList
  3. The string keys File1, File2, etc., have their intrinsic REG_SZ values set to the full pathname of your most recently opened solutions (the MRU list). By modifying those string values, you can change what appears in the "Start Page" project listing. The project names are derived from the contents of the referenced solution files (*.sln). If you wish to clear all listings, simply delete all the string keys named:
    File(nnn)

    where the (nnn) represents an increasing integer. The listing is created in an orderly manner, so modifying these keys will modify the listings. Always modify the keys in a manner that leaves no gaps; if you delete a "middle" entry, decrement the remaining entries by 1 by renaming each key entry. Again, note that no instance of .NET studio can be running, as it updates this part of the registry upon closing, using a cached copy of this registry area created during its startup, so you would lose any direct registry changes you made.

Here is a snapshot of my registry to further clarify:

Project_MRU_List_in_NET

These pathnames point to various .NET projects (either a solution or stand-alone project). The names shown in the "Start Page" are derived from the XML content in these files, and so you will not find them in the registry. Referring to the above image, if I wanted to remove an entry named "RouterTest" in my Start Page, I would simply delete the key File3 and rename File4 to File3 and File5 to File4.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionFurther modifications? Pin
mav.northwind6-Jul-04 23:49
mav.northwind6-Jul-04 23:49 
AnswerRe: Further modifications? Pin
S. Sean Stagner7-Jul-04 1:47
S. Sean Stagner7-Jul-04 1:47 
AnswerRe: Further modifications? Pin
Darren Schroeder7-Jul-04 3:52
Darren Schroeder7-Jul-04 3:52 
GeneralRe: Further modifications? Pin
mav.northwind7-Jul-04 4:11
mav.northwind7-Jul-04 4:11 
GeneralRe: Further modifications? Pin
[DAve]15-Sep-04 0:48
[DAve]15-Sep-04 0:48 
GeneralRe: Further modifications? Pin
mav.northwind15-Sep-04 1:31
mav.northwind15-Sep-04 1:31 
GeneralClickety Pin
Arjan Einbu7-Jul-04 20:27
Arjan Einbu7-Jul-04 20:27 
GeneralRe: Further modifications? Pin
S. Sean Stagner7-Jul-04 21:59
S. Sean Stagner7-Jul-04 21:59 
GeneralRe: Further modifications? Pin
Anonymous19-Jul-04 5:13
Anonymous19-Jul-04 5:13 
Here's the code for a small WinForms app that I use to clean out entries on the Visual Studio Start page:

RW


imports Microsoft.VisualBasic
imports System
Imports System.Data
imports System.Collections
imports System.ComponentModel
imports System.Drawing
imports System.Windows.Forms
Imports System.Text
Imports Microsoft.Win32

public class WindowsForm : inherits System.Windows.Forms.Form
Private m_clb As CheckedListBox
Private m_btnDeleteValues As Button

Public Sub New()
InitializeComponent
PopulateListBox
AddHandler m_btnDeleteValues.Click, AddressOf m_btnDeleteValues_Click
End Sub

Private Sub InitializeComponent
m_clb = New CheckedListBox
m_btnDeleteValues = New Button

Me.SuspendLayout()

With m_clb
.Size = New Size(Me.ClientRectangle.Width-20, _
Me.ClientRectangle.Height - 40)
.Location = New Point(10, 10)
.Anchor = AnchorStyles.Left Or AnchorStyles.Top _
Or AnchorStyles.Right Or AnchorStyles.Bottom
End With

With m_btnDeleteValues
.Size = New Size(120, _
25)
.Location = New Point(Me.ClientRectangle.Width-130, _
Me.ClientRectangle.Height - 35)
.Anchor = AnchorStyles.Right Or AnchorStyles.Bottom
.Text = "Delete Selected Keys"
End With

Me.Controls.AddRange(New Control(){m_clb, m_btnDeleteValues})
Me.ResumeLayout()
End Sub

Private Sub PopulateListBox()
Dim rkCU As RegistryKey = Registry.CurrentUser
Dim rkMRU As RegistryKey = rkCU.OpenSubKey("Software\Microsoft\VisualStudio\7.1\ProjectMRUList")
Dim ValueNames As String() = rkMRU.GetValueNames()
Dim index As Int32
Dim dt As New DataTable
With dt.Columns
.Add( New DataColumn("ValueName") )
.Add( New DataColumn("Value") )
End With
For Each v As String In ValueNames
dt.Rows.Add(New Object(){v, rkMRU.GetValue(v, "")})
Next v
rkMRU.Close()
rkCU.Close()
m_clb.DataSource = dt
m_clb.ValueMember = "ValueName"
m_clb.DisplayMember = "Value"
End Sub

Private Sub m_btnDeleteValues_Click(sender As Object, e As EventArgs)
Dim sb As New StringBuilder("The following registry values will be deleted. Do you wish to proceed?" & vbCrLf)
Dim drv As DataRowView
For Each item As Object in m_clb.CheckedItems
sb.Append(CType(item, DataRowView).Item("Value").ToString()).Append(Environment.NewLine)
Next
If DialogResult.Yes = MessageBox.Show(Me, sb.ToString(), "MRU Manager for VS.NET", MessageBoxButtons.YesNo, _
MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) Then
Dim rkCU As RegistryKey = Registry.CurrentUser
Dim rkMRU As RegistryKey = rkCU.OpenSubKey("Software\Microsoft\VisualStudio\7.1\ProjectMRUList", True)
For Each item As Object in m_clb.CheckedItems
Dim valueName As String = CType(item, DataRowView).Item("ValueName").ToString()
rkMRU.DeleteValue(valueName)
Next item
rkMRU.Close()
rkCU.Close()
End If
PopulateListBox
End Sub

End Class

public module MyModule
sub Main()
Application.Run(new WindowsForm())
end sub
end module

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.