<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/1.5.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How To Show Full File Path (or Anything Else) in VS 2005 Title Bar</title>
	<link>http://www.helixoft.com/blog/archives/32</link>
	<description>Peter Macej - lead developer of VSdocman - talks about Visual Studio tips and automation</description>
	<pubDate>Tue, 13 May 2008 04:46:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5.2</generator>

	<item>
 		<title>Comment on How To Show Full File Path (or Anything Else) in VS 2005 Title Bar by: Derek Morin</title>
		<link>http://www.helixoft.com/blog/archives/32#comment-84</link>
		<pubDate>Wed, 02 Apr 2008 00:08:33 +0000</pubDate>
		<guid>http://www.helixoft.com/blog/archives/32#comment-84</guid>
					<description>Seems to work like a charm.  Too bad it is flashy, but sounds like that is visual studios problem, and you've managed a good workaround.</description>
		<content:encoded><![CDATA[	<p>Seems to work like a charm.  Too bad it is flashy, but sounds like that is visual studios problem, and you&#8217;ve managed a good workaround.
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on How To Show Full File Path (or Anything Else) in VS 2005 Title Bar by: Peter Macej</title>
		<link>http://www.helixoft.com/blog/archives/32#comment-82</link>
		<pubDate>Mon, 03 Mar 2008 11:43:00 +0000</pubDate>
		<guid>http://www.helixoft.com/blog/archives/32#comment-82</guid>
					<description>Thank you Jimmy. You are right, the timer needs to be disposed when IDE closes. I have updated the code with your function.</description>
		<content:encoded><![CDATA[	<p>Thank you Jimmy. You are right, the timer needs to be disposed when IDE closes. I have updated the code with your function.
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on How To Show Full File Path (or Anything Else) in VS 2005 Title Bar by: Jimmy</title>
		<link>http://www.helixoft.com/blog/archives/32#comment-81</link>
		<pubDate>Mon, 03 Mar 2008 11:31:24 +0000</pubDate>
		<guid>http://www.helixoft.com/blog/archives/32#comment-81</guid>
					<description>I solved all of the problems I mentioned in my Feb 5 post.

The crash on shutdown is due to the Timer not being Disposed(). I added the following to fix that:

    Public Sub DTEEvents_OnBeginShutdown() Handles DTEEvents.OnBeginShutdown
        If Not timer Is Nothing Then
            timer.Dispose()
        End If
    End Sub

Since I wanted the macro to display information on the solution, I changed the event to be this:

    Public Sub SolutionEvents_OnOpened() Handles SolutionEvents.Opened
        SetupTitlebar()
    End Sub

   Private Sub SetupTitlebar()
        Try
            If timer Is Nothing Then
                ' Create timer which refreshes the caption because
                ' IDE resets the caption very often
                Dim autoEvent As New System.Threading.AutoResetEvent(False)
                Dim timerDelegate As System.Threading.TimerCallback = _
                    AddressOf tick
                timer = New System.Threading.Timer(timerDelegate, autoEvent, 0, 1000)
            End If

            If DTE.Solution Is Nothing Then
                ideTitle = Nothing
            Else
                Dim StartIndex As Integer
                Dim EndIndex As Integer
                Dim Found As Boolean

                Found = False

                ideTitle = DTE.Solution.FullName

                StartIndex = InStr(ideTitle.ToLower(), &quot;:\&quot;)
                If (StartIndex &amp;#62; 0) Then
                    ideTitle = Mid(ideTitle, StartIndex + 2)
                    Found = True

                    StartIndex = InStr(ideTitle.ToLower(), &quot;dev\&quot;)
                    If (StartIndex = 1) Then
                        ideTitle = Mid(ideTitle, StartIndex + 4)
                    End If
                End If

                If (Found) Then
                    EndIndex = InStr(ideTitle, &quot;\&quot;)
                    If (EndIndex &amp;#62; 0) Then
                        ideTitle = Left(ideTitle, EndIndex - 1)
                    End If
                End If
            End If

            showTitle(ideTitle)
        Catch ex As System.Exception
        End Try
    End Sub

This also fixed the focus problems with FindInFiles</description>
		<content:encoded><![CDATA[	<p>I solved all of the problems I mentioned in my Feb 5 post.</p>
	<p>The crash on shutdown is due to the Timer not being Disposed(). I added the following to fix that:</p>
	<p>    Public Sub DTEEvents_OnBeginShutdown() Handles DTEEvents.OnBeginShutdown<br />
        If Not timer Is Nothing Then<br />
            timer.Dispose()<br />
        End If<br />
    End Sub</p>
	<p>Since I wanted the macro to display information on the solution, I changed the event to be this:</p>
	<p>    Public Sub SolutionEvents_OnOpened() Handles SolutionEvents.Opened<br />
        SetupTitlebar()<br />
    End Sub</p>
	<p>   Private Sub SetupTitlebar()<br />
        Try<br />
            If timer Is Nothing Then<br />
                &#8216; Create timer which refreshes the caption because<br />
                &#8216; IDE resets the caption very often<br />
                Dim autoEvent As New System.Threading.AutoResetEvent(False)<br />
                Dim timerDelegate As System.Threading.TimerCallback = _<br />
                    AddressOf tick<br />
                timer = New System.Threading.Timer(timerDelegate, autoEvent, 0, 1000)<br />
            End If</p>
	<p>            If DTE.Solution Is Nothing Then<br />
                ideTitle = Nothing<br />
            Else<br />
                Dim StartIndex As Integer<br />
                Dim EndIndex As Integer<br />
                Dim Found As Boolean</p>
	<p>                Found = False</p>
	<p>                ideTitle = DTE.Solution.FullName</p>
	<p>                StartIndex = InStr(ideTitle.ToLower(), &#8220;:\&#8221;)<br />
                If (StartIndex &gt; 0) Then<br />
                    ideTitle = Mid(ideTitle, StartIndex + 2)<br />
                    Found = True</p>
	<p>                    StartIndex = InStr(ideTitle.ToLower(), &#8220;dev\&#8221;)<br />
                    If (StartIndex = 1) Then<br />
                        ideTitle = Mid(ideTitle, StartIndex + 4)<br />
                    End If<br />
                End If</p>
	<p>                If (Found) Then<br />
                    EndIndex = InStr(ideTitle, &#8220;\&#8221;)<br />
                    If (EndIndex &gt; 0) Then<br />
                        ideTitle = Left(ideTitle, EndIndex - 1)<br />
                    End If<br />
                End If<br />
            End If</p>
	<p>            showTitle(ideTitle)<br />
        Catch ex As System.Exception<br />
        End Try<br />
    End Sub</p>
	<p>This also fixed the focus problems with FindInFiles
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on How To Show Full File Path (or Anything Else) in VS 2005 Title Bar by: yusheng</title>
		<link>http://www.helixoft.com/blog/archives/32#comment-80</link>
		<pubDate>Mon, 03 Mar 2008 08:11:13 +0000</pubDate>
		<guid>http://www.helixoft.com/blog/archives/32#comment-80</guid>
					<description>This article is very useful for me. I want to write a samilar macros, however, there are some errors.
when the WindowActivated event occurs, I want to adjust the activetated document window. I try to set the GotFocus.Width, it throws an Exception. Then I use the SetWindowPos for a try. But the value of GotFocus.HWnd is zero. The HWnd property is only used for Microsoft in MSDN. I'm not good at VB. I hope you can give me some suggestion about how to adjust the window in this situation. Please email me, yusheng9966@gmail.com</description>
		<content:encoded><![CDATA[	<p>This article is very useful for me. I want to write a samilar macros, however, there are some errors.<br />
when the WindowActivated event occurs, I want to adjust the activetated document window. I try to set the GotFocus.Width, it throws an Exception. Then I use the SetWindowPos for a try. But the value of GotFocus.HWnd is zero. The HWnd property is only used for Microsoft in MSDN. I&#8217;m not good at VB. I hope you can give me some suggestion about how to adjust the window in this situation. Please email me, <a href="mailto:yusheng9966@gmail.com">yusheng9966@gmail.com</a>
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on How To Show Full File Path (or Anything Else) in VS 2005 Title Bar by: Jimmy</title>
		<link>http://www.helixoft.com/blog/archives/32#comment-76</link>
		<pubDate>Mon, 04 Feb 2008 23:20:58 +0000</pubDate>
		<guid>http://www.helixoft.com/blog/archives/32#comment-76</guid>
					<description>I love this macro but I noticed it causes some undesirable side effects in the IDE:

1) Find in Files window has focus taken away from it when I click in it. The workaround is to first click the titlebar for the window and then I can navigate around in it, but the usability is really hampered here.

2) The IDE usually crashes on shutdown. The crash happens in the VS Macros host.

3) The macro only works if a source file is opened. Is there a way to have it use the path of the open Solution instead in that case?

Any ideas how these issues could be worked around?</description>
		<content:encoded><![CDATA[	<p>I love this macro but I noticed it causes some undesirable side effects in the IDE:</p>
	<p>1) Find in Files window has focus taken away from it when I click in it. The workaround is to first click the titlebar for the window and then I can navigate around in it, but the usability is really hampered here.</p>
	<p>2) The IDE usually crashes on shutdown. The crash happens in the VS Macros host.</p>
	<p>3) The macro only works if a source file is opened. Is there a way to have it use the path of the open Solution instead in that case?</p>
	<p>Any ideas how these issues could be worked around?
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on How To Show Full File Path (or Anything Else) in VS 2005 Title Bar by: Peter Macej</title>
		<link>http://www.helixoft.com/blog/archives/32#comment-75</link>
		<pubDate>Wed, 30 Jan 2008 08:05:16 +0000</pubDate>
		<guid>http://www.helixoft.com/blog/archives/32#comment-75</guid>
					<description>You are right. You have probably set Option Strict On in your macros. The solution is simple. Just use:
SetWindowText(New System.IntPtr(DTE.MainWindow.HWnd), ideTitle &amp;#38; &quot; - &quot; &amp;#38; DTE.Name)
I will update the main post as well.</description>
		<content:encoded><![CDATA[	<p>You are right. You have probably set Option Strict On in your macros. The solution is simple. Just use:<br />
SetWindowText(New System.IntPtr(DTE.MainWindow.HWnd), ideTitle &amp; &#8221; - &#8221; &amp; DTE.Name)<br />
I will update the main post as well.
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on How To Show Full File Path (or Anything Else) in VS 2005 Title Bar by: santosh</title>
		<link>http://www.helixoft.com/blog/archives/32#comment-74</link>
		<pubDate>Wed, 30 Jan 2008 04:46:19 +0000</pubDate>
		<guid>http://www.helixoft.com/blog/archives/32#comment-74</guid>
					<description>The Macro is not compiling [ok I am trying this for VS 2003]
        SetWindowText(DTE.MainWindow.HWnd, ideTitle &amp;#38; &quot; - &quot; &amp;#38; DTE.Name)
HWND is integer whereas it is expected System.IntPtr. 

Did you try this with 2003 as well? or is there some setting with that IDE?

Thanks for your time!!</description>
		<content:encoded><![CDATA[	<p>The Macro is not compiling [ok I am trying this for VS 2003]<br />
        SetWindowText(DTE.MainWindow.HWnd, ideTitle &amp; &#8221; - &#8221; &amp; DTE.Name)<br />
HWND is integer whereas it is expected System.IntPtr. </p>
	<p>Did you try this with 2003 as well? or is there some setting with that IDE?</p>
	<p>Thanks for your time!!
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on How To Show Full File Path (or Anything Else) in VS 2005 Title Bar by: Charles</title>
		<link>http://www.helixoft.com/blog/archives/32#comment-70</link>
		<pubDate>Thu, 11 Oct 2007 21:15:54 +0000</pubDate>
		<guid>http://www.helixoft.com/blog/archives/32#comment-70</guid>
					<description>This is GREAT! It works well... now how about something similar for Visual Studio 6? For long paths, all I get is &quot;[C:\...\DStringUtils.h]&quot;  

Charles.</description>
		<content:encoded><![CDATA[	<p>This is GREAT! It works well&#8230; now how about something similar for Visual Studio 6? For long paths, all I get is &#8220;[C:\&#8230;\DStringUtils.h]&#8221;  </p>
	<p>Charles.
</p>
]]></content:encoded>
				</item>
	<item>
 		<title>Comment on How To Show Full File Path (or Anything Else) in VS 2005 Title Bar by: kyong</title>
		<link>http://www.helixoft.com/blog/archives/32#comment-66</link>
		<pubDate>Tue, 31 Jul 2007 16:20:26 +0000</pubDate>
		<guid>http://www.helixoft.com/blog/archives/32#comment-66</guid>
					<description>tried it out, but having to refresh every 200 milliseconds kills the mojo for me...   maybe if there was a simpler way..  =)  but nice work!!</description>
		<content:encoded><![CDATA[	<p>tried it out, but having to refresh every 200 milliseconds kills the mojo for me&#8230;   maybe if there was a simpler way..  =)  but nice work!!
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
