03-28-2020 05:51 PM
Hi everybody!
I set Windows to use a default .exe application while opening a ".test" file type.
The default application in my case is a labview .exe that i've built, that just let you set some values in a cluster and then save a binary file that contains the cluster itself.
The application also have a piece of code running at the start that reads the command line arguments and automatically set the value of the cluster if the application was opened directly from a .test file......easy enough!
I was asking myself if i can repeat the process even if the application is already running, catching another .test file opening.
When i doubleclick a .test file and the application is already running, i can see the window of my .exe became active, but the command line arguments of the application reamains the same of the application start! (as i expected...to be honest)
Can anybody help me? Is it a possible thing to do?
-Freddy
Solved! Go to Solution.
03-28-2020 06:53 PM
03-30-2020 07:58 AM
Thank you for replying altenbach!
But what if i want to open the file in the same instance?
03-30-2020 10:01 AM - edited 03-30-2020 10:44 AM
Then there needs to be a communication method between the launcher and the actual application. The launcher can then send a message to the already running application and it can handle it as if the file was selected to be opened. There are many methods to accomplishing this. If I were asked the easiest method to accomplish this I'd go with a named queue that is read periodically with a timeout.
Also as for setting up the file association. There are several ways to do this from an installer. Here is an older method that I think still works but requires editing the registry which Windows might not allow due to various permissions and UAC settings. I typically create my own installer using InnoSetup and ISTool which have a section for making a file type associated with an EXE.
Edit: Named queues don't work between applications, I was thinking of something else. Another communication method would have to be used.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord