From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading a file by double clicking through an existing EXE

I have a Main LabVIEW application running. It is an .exe. It has a text editor in it.

Before the application is loaded, I can double click on a text file and get applicationArgs to read the file and populate my text editor.

If the application is already running, how would I get this path information into my application so that it can be loaded into the text editor?
I have tried creating a second LabVIEW .exe that will take the applicationArgs and pass it over a network queue into my Main application, and while this works, the second .exe takes about 5 seconds to launch, which is insufficient.
Any thoughts?

Many thanks, Alec

0 Kudos
Message 1 of 7
(2,460 Views)

Maybe you can handle a drag-and-drop event to populate the editor's contents with the contents of the file that was dropped.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(2,443 Views)

Hmmm, Only if I had a Path Control there.

Also, Drag and Drop ain't no Double Click 😕

Ta.

0 Kudos
Message 3 of 7
(2,437 Views)

Perhaps you can register for an OS event triggered by double clicking, and then filter the events? What are you running on? (Windows?)


GCentral
0 Kudos
Message 4 of 7
(2,432 Views)

LabVIEW on Windows, yes.

0 Kudos
Message 5 of 7
(2,427 Views)

Ho would I register for an OS level event? I thought as high level I could get was VI Server?

0 Kudos
Message 6 of 7
(2,426 Views)

My suggestion would be looking into functions like this: WM_LBUTTONDBLCLK

You'll have to either use the Call Library Function Node with libraries probably located in the Windows directory, or if you need a bunch of functions and have any peculiar data structures required, I'd suggest writing some code in C/C++ and the making it more accessible to your LabVIEW needs.

 

You can additionally generate events in your own C code for LabVIEW's Event Structure - I can post an example I've written later but you can probably google for the idea. This might be helpful if you do write some other library. You can use the entry point to try and register for the Windows OS events you need, but be careful because you're not allowed to load any non-loaded libraries in that part of the DLL.

 

If you can at all avoid it, you'd be better doing so. Perhaps you can use the second application you have to load data in, and have it always running? I'm not sure exactly how you're loading these, or how your application works, so it's hard to say.

 


GCentral
0 Kudos
Message 7 of 7
(2,404 Views)