Solved

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

Posted on 2002-07-11
19
315 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
  • 3
  • +4
19 Comments
 
LVL 30

Expert Comment

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

That will give you the full path.
0
 

Author Comment

by:bleek
ID: 7146929
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
ID: 7147035
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 30

Expert Comment

by:Axter
ID: 7147049
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
ID: 7147105
We're running Visual C++ ver. 6.0
0
 
LVL 22

Expert Comment

by:ambience
ID: 7148352
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
ID: 7148397
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
ID: 7148488
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
ID: 7148874
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
 

Expert Comment

by:gpbaldazzi
ID: 7149008
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
ID: 7149283
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
ID: 7149907
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
ID: 7149938
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
ID: 7376016
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
ID: 7376106
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
ID: 7378309
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
ID: 7380576
O.K.  Objection witdrawn.  -- Dan
0
 

Author Comment

by:bleek
ID: 7382820
Thanks to all who tried to help.
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
ID: 7419831
Points refunded and moved to PAQ

** Mindphaser - Community Support Moderator **
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

739 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