Solved

How do I get full path in title bar of Visual C++ Window?

Posted on 2002-07-11
19
295 Views
Last Modified: 2008-02-26
When editing a file in the Visual C++ environment, sometimes I just get the filename with no path or just a partial path in the window title bar.  Since I am frequently looking at more than two copies of the same file at the same time, it would be helpful to see the path so that I know that I am editing the correct one.  Is there a setting for the whole Visual C++ environment that will do this for me?  Even if I had to set a flag in each file, it would save me from changing the wrong file by mistake.
0
Comment
Question by:bleek
  • 7
  • 5
  • 3
  • +4
19 Comments
 
LVL 30

Expert Comment

by:Axter
Comment Utility
You can right click the file you're editting, and select properties.

That will give you the full path.
0
 

Author Comment

by:bleek
Comment Utility
I was looking for something that would display in the title bar.  Is there a limit for the number of charactors that can be displayed in the title bar?  Frequently, the 2 files I'm looking at have the same final directory.  It's the directories right after the drive name : that I need to see.  Right clicking didn't give me the full path.
0
 
LVL 30

Expert Comment

by:Axter
Comment Utility
An alternative solution could be to add the following macro to VC++:

Sub ShowFullTitle()
MsgBox "Document full path = " + Application.ActiveDocument.FullName , vbOKOnly, Application.ActiveDocument.FullName
End Sub
0
 
LVL 30

Expert Comment

by:Axter
Comment Utility
Unfortunately the Caption property of the TextWindow object is readonly.
Other wize you could have done something like the following macro:
Application.ActiveDocument.Caption = Application.ActiveDocument.FullName

But like I said, Caption is readonly, so that won't work.

What version of VC++ do you have?
0
 

Author Comment

by:bleek
Comment Utility
We're running Visual C++ ver. 6.0
0
 
LVL 22

Expert Comment

by:ambience
Comment Utility
Axter , i am not finding it but is there any way to set text in status bar, its better than a msgbox
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
If you open the properties box and click that little pushpin-looking thingy, then no matter what source window you click, the full path will be displayed.

In the same situation, I always drag the 'source' or 'old' file window up and to the right and the 'dest' or 'new' window down and to the left.  Having set that little rule firm and fast in my mind, I never have to wonder which window is which.

I cannot find anything anywhere that overrides the width to which DevStudio automatically truncates long filenames displayed in the source window captions.

-- Dan
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
On a hunch, I tried playing around with some system metrics, with the idea that the IDE might base the truncation on some other item.  No luck (but I did not try everything).

I did discover something that is useful.  You know when you minimze a window in the IDE, it is almost impossible to tell what it is becasue it is so narrow that the truncation ends up with
   C:\...\MyP...
virtually useless.  But if you execute the following code, the minimized windows in all MDI apps will be wider, so the caption is readable:

MINIMIZEDMETRICS rMM;
rMM.cbSize= sizeof( rMM );

BOOL fRet= SystemParametersInfo( SPI_GETMINIMIZEDMETRICS, sizeof( rMM ), &rMM, 0);

rMM.iWidth= 300; // <<<--- set width of minimized window

fRet= SystemParametersInfo( SPI_SETMINIMIZEDMETRICS, sizeof( rMM ), &rMM, SPIF_SENDCHANGE );

To save it permanently, OR in SPIF_UPDATEINIFILE with the flags in the final parm

-- Dan
0
 

Author Comment

by:bleek
Comment Utility
I think our paths may be to long, even with the push pin it shows "D:\..\dir2\dir3\filename.  It may not be possible to do this.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Expert Comment

by:gpbaldazzi
Comment Utility
I use WndTabs, a powerful add-in for VS6.
It's freeware, unless you want to use the WndTabsEx module (10 $ registration)
You can have a look at:
http://www.wndtabs.com/wt/tour/

It has many features, all related to tabs appended above the editor window. One of these features is that the tab tooltip is the full path of current file. it could be helpful to you.

Gian Paolo

0
 

Author Comment

by:bleek
Comment Utility
Thanks for the idea.  I looked at the link.  However, we've got over 20 machines in a development environment and can't risk adding it.
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
If it happens regularly that you have two files with the same name and extension but from different directories open at the same time... you should reconsider your naming conventions!

I run accros the situation occasionally, when referring to a file from a backup copy of a project.  In that case the directory is named xMyProj rather than MyProj, so it shows up in the truncated pathname shown in window title.  But as I say, it happens rarely and I just postion the windows has a visual cue.  

Did you try keeping the property window 'pinned' open?

-- Dan
0
 

Author Comment

by:bleek
Comment Utility
We are doing some parallel development which makes it necessary to have the files with the same name, just located in different directories.  The directory structure goes rather deep, so even using the push pin we are not getting the names of the top level directories listed.
0
 
LVL 11

Expert Comment

by:griessh
Comment Utility
Dear bleek

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to

     "refund the points and move to PAQ"

since nobody had a satisfying answer for you.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
greissh,
I object.  I belive that my suggestion of keeping the Properties box "pinned" open would solve bleek's problem.

My other tip, of moving the two-similar-named windows to certain parts of the MDI window is also a winner...  For instance, I always place the "source" window in the top-right corner.  Then I have a visual cue that helps me keep track of which window is which.

-- Dan
0
 

Author Comment

by:bleek
Comment Utility
Unfortunately, this doesn't show the whole path.  I get
d:\...\directory\directory\filename.  Someone int their infinite wisdom has the projects with exteremely big paths.  It the beginning of the paths that I need to see since when working with old and new projects, it's the first directory that is different.
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
O.K.  Objection witdrawn.  -- Dan
0
 

Author Comment

by:bleek
Comment Utility
Thanks to all who tried to help.
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
Comment Utility
Points refunded and moved to PAQ

** Mindphaser - Community Support Moderator **
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now