views:

233

answers:

1

I have written a small plug in for Visual Studio 2005. It displays the name and the shortcuts of the last command you have used (nice for learning seldom used command's shortcuts).

I display this information in a window that I manually dock between the project explorer and the property panel.

The problem : every time I start Visual Studio, this window come back in the middle of the screen. It does not remember its last position. I will have to dock it programmatically.

Question : Where should I save the information about the window's size and position when the user close it ? Does some kind of store already exists for this usage in Visual Studio or do I have to find one by myself (say - Windows Repository) ?

Note : I create this window using Window2.CreateToolWindow2()

Thanks in advance, Sylvain.

+2  A: 

AFAIK this information is stored in registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\ Visual studio version - 8.0 or 9.0 \ToolWindows{YourToolWindowGuid}, unfortunately I don't remember exact structure of this key.

If you add guid of your window to ToolWindows branch MSVS will persist state of your window automatically.

aku
Great tips ! The keyword was 'persist' - using it and 'ToolWindow' on MSDN, I found a Visual Studio SDK and a sample plug-in doing just that. Many thanks - Sylvain.
Sylvain