Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

VSWindowManager-like for 2008?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lasse Vågsæther Karlsen - 11 Mar 2008 14:49 GMT
I'm hoping someone here knows how to get something like the
VSWindowManager addin, only for Visual Studio 2008.

I have a laptop with a dual-monitor solution at work, but I frequently
need to undock the laptop and use on travels, home, in meetings, etc..
and my carefully laid out tool windows (solution explorer, properties,
output, etc.) all get wrapped back and saved to the main monitor when I
do this.

I can easily use a macro if someone just gives me a hint on how to
position these windows through code. I tried recording a macro for it,
but it didn't seem to understand these things.

In other words, I don't need anything as fancy as VSWindowManager, no
automatic handling at all, I just need to be able to relatively quickly
be able to restore the positions of the windows to some preset location.

Signature

Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3

Lasse Vågsæther Karlsen - 11 Mar 2008 15:08 GMT
> I'm hoping someone here knows how to get something like the
> VSWindowManager addin, only for Visual Studio 2008.
[quoted text clipped - 12 lines]
> automatic handling at all, I just need to be able to relatively quickly
> be able to restore the positions of the windows to some preset location.

Ok, a bit quick on the trigger, figure I can increase my chance of
getting some help if I post what I've tried.

I have the following macro code:

    Private Function GetWindow(ByVal Caption As String) As EnvDTE.Window
        For Index = 1 To DTE.Windows.Count
            Dim result As EnvDTE.Window
            result = DTE.Windows.Item(Index)
            Trace.WriteLine(result.Kind & ": " & result.Caption)
            If result.Kind = "Tool" And
result.Caption.StartsWith(Caption) Then
                Return result
            End If
        Next
        Return Nothing
    End Function

    Private Sub Position(ByVal Caption As String, ByVal x As Integer,
ByVal y As Integer, ByVal w As Integer, ByVal h As Integer)
        Dim window As EnvDTE.Window = GetWindow(Caption)
        window.Left = x
        window.Top = y
        window.Width = w
        window.Height = h
    End Sub
    Public Sub DualMonitor()
        ' Position("Solution Explorer", 1284, 20, 363, 670)
        ' Position("Properties", 1284 + 370, 20, 363, 692)
        Position("Output", 1284, 20 + 692, 1000, 300)
    End Sub

Not very good I'll admit. The solution explorer is docket together with
the server explorer and toolbox, and the 670 there is the height with
the tabs at the bottom, whereas the properties window is by itself so it
has to be set to 692 and not 670.

I'd like to be able to undock and dock the windows together so that I
can make one macro that docks everything into the main window like it
appears by default, and one macro that pulls everything out and groups
the tool windows together the way I want them on a dual-monitor display.

Anyone have any pointers to how I might accomplish the docking bit?

Signature

Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3

Lasse Vågsæther Karlsen - 11 Mar 2008 15:36 GMT
>> I'm hoping someone here knows how to get something like the
>> VSWindowManager addin, only for Visual Studio 2008.
[quoted text clipped - 57 lines]
>
> Anyone have any pointers to how I might accomplish the docking bit?

Ok, more info.

By following the data on MSDN I am now able to move the windows
correctly, undock them and "dock" them.

By "dock" I mean that I can create a frame for docking two windows into
it, and they are docked with tabs. However, as soon as I add the third
window, the frame is split into two, with the two tabs in the top half
and the third window in the bottom half, sort of like this:

+-------------------------+
|                         |
| first window            |
|                         |
|                         |
+------+------+-----------+
| tab1 | tab2 |           |
+------+------+-----------+
|                         |
| third window            |
|                         |
|                         |
+-------------------------+

Any idea how I can make the third window be added as a tab instead of
splitting the frame in two?

I'll post my code when I'm if anyone's interested.

Signature

Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3

Lasse Vågsæther Karlsen - 11 Mar 2008 15:38 GMT
>> I'm hoping someone here knows how to get something like the
>> VSWindowManager addin, only for Visual Studio 2008.
[quoted text clipped - 57 lines]
>
> Anyone have any pointers to how I might accomplish the docking bit?

Also, any idea on how to get hold of the "Pending Checkins" window, as
well as the "Error List" window? They don't seem to have a constant in
the Constants.vsWindowKind* list...

Signature

Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.