LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use a labview application as default app for a specific file extension

Solved!
Go to solution

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

0 Kudos
Message 1 of 4
(1,899 Views)

Thank you for replying altenbach!

But what if i want to open the file in the same instance?

0 Kudos
Message 3 of 4
(1,808 Views)
Solution
Accepted by topic author FreddyV

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.

Message 4 of 4
(1,800 Views)