04-03-2014 04:14 PM
We are currently doing some Git automation in which all developer work folders will get updated automatically. However, the automation script should skip a developer folder if CVI is open from that folder. For example, assume there are three folders.
If dev2 has myproj.prj open, the script will skip that folder. The way we tried to determine if a particular project is open is as follows:
1. Determine if CVI process is running.
2. If yes, get CVI window title.
We wrote a Win32 C++ utility for this purpose. Since the title shows the full workspace path, this information was sufficient. But recently, we noticed that if the path is too long, CVI shortens it (eg: c:\..\folder\myproj.prj). At the same time, if I hover the mouse on the title bar area, CVI shows a tool tip with the full path.
So I was wondering if there is any way I can read the tool tip string? Suggestions on approaching this in some other way are also welcome.
Solved! Go to Solution.
04-04-2014 01:27 PM
You could use ActiveX automation to connect to a running instance of CVI to find out what the current project is.
Once you determine that an instannce of CVI is running, you can then call CVI_ActiveApp to connect to it (look at samples\activex\cvi\build.prj if you're not familiar with ActiveX automattion). The one caveat is that it's hard to control which instance of CVI will be used by CVI_ActiveApp, in case more than one is running. But you can always also use the CVI_AppGetCVIProcessId function to confirm that you have the right one (whatever the "right one" means, in that case).
Once you have a connection, then you can use CVI_AppGetCurrentProject.
Luis
04-04-2014 02:55 PM
Thank you. Looks like this is the best way to handle this. Will give this a try.