william007
asked on
Display full path of the project
Hi, I have a project called MyProject.vbp, and I have multiple copy of it under different folder
eg
C:\MyProject(Testing)\MyPr oject.vbp
C:\MyProject(Production)\M yProject.v bp
C:\MyProject(Old)\MyProjec t.vbp
Sometimes, I will open 3 of them at the sametime.
However, this make me confuse as on the TitleBar, it only displays the project name
eg
MyProject - ......
Is there anyway to show the full project path on the title bar, or any other convenient way to know what full project path I am working on?
(P/S: Currently, I always use the File>SaveAs, as by default it is save into the current folder, so I knew what folder I am working on, but is there any more convenient way like showing it in the title bar?)
eg
C:\MyProject(Testing)\MyPr
C:\MyProject(Production)\M
C:\MyProject(Old)\MyProjec
Sometimes, I will open 3 of them at the sametime.
However, this make me confuse as on the TitleBar, it only displays the project name
eg
MyProject - ......
Is there anyway to show the full project path on the title bar, or any other convenient way to know what full project path I am working on?
(P/S: Currently, I always use the File>SaveAs, as by default it is save into the current folder, so I knew what folder I am working on, but is there any more convenient way like showing it in the title bar?)
Why not just call them 3 different names
MyProjectTest.vbp MyProjectProd.vbp MyProjectOld.vbp
MyProjectTest.vbp MyProjectProd.vbp MyProjectOld.vbp
ASKER
Hi, ryancys,
App.path is only in runtime. Is there a method that we can see the project path in design time?
Hi, lyonst,
Thanks, there is one of the option, as we can see the file name at the properties windows to know the project. But is there a option to displays full path somewhere in the design view? So I do not need to rename all the file that supposed to have same name...
App.path is only in runtime. Is there a method that we can see the project path in design time?
Hi, lyonst,
Thanks, there is one of the option, as we can see the file name at the properties windows to know the project. But is there a option to displays full path somewhere in the design view? So I do not need to rename all the file that supposed to have same name...
Why dont you just include some comments in you code reflecting which project it is..
don't think you can do from IDE
However, you can open your vbp file from notepad and change the field
Name="otherProject1"
However, you can open your vbp file from notepad and change the field
Name="otherProject1"
Or include a dummy form that contains this information in its name etc .. visible at design time.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
how 'bout hard-coding the caption of the main form to reflect the path of the test one and the "old" one?
don't have vb readily available to me while I'm typing this but, doesn't the project properties window give the path?
Yes its possible you need to create an addin project and then when you load up your project you can make the tittle bar the project path.
or you can add a button to the toolbars that displays the path when clicking on it
ASKER
Hi, egl1044
What is addin project, can you elaborate a bit how it can be done?
Hi, Mark_FreeSoftware
How to add a button to the toolbar?
What is addin project, can you elaborate a bit how it can be done?
Hi, Mark_FreeSoftware
How to add a button to the toolbar?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The code...
Option Explicit
Public VBInstance As VBIDE.VBE
Private Declare Function FindWindowW Lib "user32.dll" ( _
ByVal lpClass As Long, _
ByVal lpWindow As Long) As Long
Private Declare Function SetWindowTextW Lib "user32.dll" ( _
ByVal hwnd As Long, _
ByVal lpString As Long) As Long
Private Sub AddinInstance_OnConnection (ByVal Application As Object, ByVal ConnectMode As AddInDesignerObjects.ext_C onnectMode , ByVal AddInInst As Object, custom() As Variant)
Set VBInstance = Application
End Sub
Private Sub AddinInstance_OnStartupCom plete(cust om() As Variant)
Dim hwnd As Long
Dim capt As String
capt = VBInstance.ActiveVBProject .FileName
hwnd = FindWindowW(StrPtr("wndcla ss_desked_ gsk"), 0)
SetWindowTextW hwnd, StrPtr(capt)
Set VBInstance = Nothing
End Sub
Option Explicit
Public VBInstance As VBIDE.VBE
Private Declare Function FindWindowW Lib "user32.dll" ( _
ByVal lpClass As Long, _
ByVal lpWindow As Long) As Long
Private Declare Function SetWindowTextW Lib "user32.dll" ( _
ByVal hwnd As Long, _
ByVal lpString As Long) As Long
Private Sub AddinInstance_OnConnection
Set VBInstance = Application
End Sub
Private Sub AddinInstance_OnStartupCom
Dim hwnd As Long
Dim capt As String
capt = VBInstance.ActiveVBProject
hwnd = FindWindowW(StrPtr("wndcla
SetWindowTextW hwnd, StrPtr(capt)
Set VBInstance = Nothing
End Sub
ASKER
Thanks, this is the best method for the moment=)
I have asked two relevants question here
https://www.experts-exchange.com/questions/21788458/When-Run-the-program-full-path-on-the-IDE-Using-Add-in-is-dissapear.html
and
https://www.experts-exchange.com/questions/21788455/How-to-Install-and-remove-the-add-in.html
I have asked two relevants question here
https://www.experts-exchange.com/questions/21788458/When-Run-the-program-full-path-on-the-IDE-Using-Add-in-is-dissapear.html
and
https://www.experts-exchange.com/questions/21788455/How-to-Install-and-remove-the-add-in.html
ASKER
>>Thanks, this is the best method for the moment=)
But slowly I discover, when there is a switching of form, the title will be overrided with the IDE default title=( However, I think using add-in is a good start..I am thinking whether it is possible to subscribe the switching form event or something similar.
But slowly I discover, when there is a switching of form, the title will be overrided with the IDE default title=( However, I think using add-in is a good start..I am thinking whether it is possible to subscribe the switching form event or something similar.
Hmmm.. The only way I see that is when the Code Window is maximized? Is that the case? It should only change the main IDE caption.
ASKER
Sorry, when I see it clearly, it is not dissapear when we switch the form, is when we run the program, sorry for the wrong info.
ASKER
Now I am thinking whether it is possible to subscribe the form running event or something similar;)
You can do just about anything using Add-Ins. I updated the project dont know if there is an actuall property that lets you change the caption so thats why I am using the windows API because I am un-certain. This is rather a work around the changing of the title bar whenever it changes but I don't know how good it will be until you use it for awhile.
http://www.geocities.com/egl1044/PROJECTS/IDE_tbar.zip
http://www.geocities.com/egl1044/PROJECTS/IDE_tbar.zip
ASKER
Hi, egl1044,
Can you post it at
https://www.experts-exchange.com/questions/21788458/When-Run-the-program-full-path-on-the-IDE-Using-Add-in-is-dissapear.html
I have changed the question a bit.
I will going to grade this question now.
Can you post it at
https://www.experts-exchange.com/questions/21788458/When-Run-the-program-full-path-on-the-IDE-Using-Add-in-is-dissapear.html
I have changed the question a bit.
I will going to grade this question now.
ASKER
Thanks for the comment..:-)
You can close that other question since it is still related to this question. I think the above might work fine.
ASKER
I have deleted the question. Seems like it is working OK now! Thanks:-)
msgbox app.path