Running exe opening associated extension

My LabVIEW built application is associated with a specific file type in Windows:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/630ed1d9-73f1-4cc0-bc84-04f29cffc13b/what-regi...
and opens double clicked file using command line argument:
http://forums.ni.com/t5/LabVIEW/passing-files-into-labview-vi-by-opening-the-file/m-p/138968/highlig...
This allows me to _launch_ my application, when user double clicks file with specified extension and process this file.
But it happens only if application is not running.
What should I do if I want to open the double clicked file while my program is running? 
Any system event happening that I can register and process?
The only way I see now is to build an intermediate  application that will be associated with extension, check if main application is running and pass arguments to it.
Solved!
Go to Solution.

Alexander_Sobolev
Well, there were many discussions about it, e.g. 1, 2, 3 and in early days I have tried some ways of DDE implementation in my apps. Maybe, you could use private property of LabVIEW which is named "OS Open Document" (needs SuperSecretPrivateSpecialStuff=True string in Labview.ini for it to be visible in Events' configuration window). More info is presented here and here, and it worked for me... Also I've been searching for more elegant way and have found this article. LabVIEW has already built-in DDE server and your application may receive WM_DDE_EXECUTE message with the help of system API calls. So, I made an example of such receiver - it works when you have registered some file extension in Windows (HKEY_CLASSES_ROOT branch in the registry) and is double-clicking your file. It also works when you double-click a shortcut to your application and when you double-click your app's exe, even when it is already running. It isn't working if you registered your file extension with ddeexec key (equals to open(%1)) together with command key (equals to "Path to your app\App.exe" "%1"). But in this case the private property "OS Open Document" works! And you may even use both methods or may choose one of them.
For the simplicity look at these registry keys. If you registered *.ton file extension you should have
[HKEY_CLASSES_ROOT\.ton]
@="ton_auto_file"
 and
[HKEY_CLASSES_ROOT\ton_auto_file\shell\open\command]
@="\"C:\\Test\\Application.exe\" \"%1\""
 keys in the registry. In this case method 1 will work. If you add this key
[HKEY_CLASSES_ROOT\ton_auto_file\shell\open\ddeexec]
@="open(%1)"
 then method 1 won't work but method 2 ("OS Open Document") will work.
My test program is in the attachment (LV 2011). It requires Windows Message Queue Library (second link is for LV 2009 and greater) for DDE message interception. You may integrate message listener loop in parallel thread in your app and stop it with notifier or similar mechanism.
Attachments:
DDE_Test3.vi ‏35 KB

Similar Messages

  • Why does compiled (EXE) VI run when you double-cli​ck the icon even though I un-checked "Run When Opened"?

    My VI code uses the VI's that came with the NI  USB-8451  USB-to-SPI converter.  Before compiling I needed to use one of those VI's to select the particular USB device that I'm trying to address, then I click the Run button.  But after I compile my code into an EXE file, and then double-click the executable file it immediately starts running without allowing me to select the USB device - even though I un-checked the "Run When Opened" box.  In fact I also un-checked the Show Menu Bar and Show Scroll Bars boxes as well, yet it shows both of them.  What am I doing wrong?

    It seems silly to start and stop a built LabVIEW application from the toolbar. A complete application should always run and have the LabVIEW toolbar hidden. A user of you code is not supposed to be familiar with LabVIEW mechanics.
    You should do all this in code. Really!
    Do a nice state machine with at least two states. (1) a state for where the device has not been entered and is simply waiting for your input, and (2) another state that verifies your device input and hands it to the rest of the code for afterwards.
    Still, what LabVIEW version do you have. Did you set the "run when openend" setting in the application builder for the desired VI or just in the VI itself?
    LabVIEW Champion . Do more with less code and in less time .

  • In application builder the top level vi is always set to "run when opened"; how do I turn this off so I don't have to change it each and every time I build a .exe??

    I build a lot of executables using Application Builder under LabVIEW and in every one I build, I don't want the top level vi to take off and run when I open the executable. Currently, I edit each .exe I build within Application Builder and change the option of "run when opened" from Yes to No for the top level vi. All the other subvi's are already set to No. It would seem as though there should be some way to "turn this off" if you will so the top level vi is not always set to "run when opened" by default within Application Builder. Is there such a solution that anyone knows of?? Any help would be apprec
    iated... thanks...

    Indeed the Application builder forces "run when opened" to true for top levels VIs. If you don't want your VI to make any real work when the application starts, you should simply put a do-nothing loop in the beginning of the VI that will loop until the user presses a boolean. It will be more intuitive for users to press a Run button on the FP than clicking on the white Run arrow in the bar.
    LabVIEW, C'est LabVIEW

  • I am trying to update Firefox. When I click on "dowload" the box pops up and says "save file" or "cancel". Usually it says "Run" or "open".. how do I fix this so I can do the update ?

    Not sure if this problem is with firefox or with my computer in general. I can't seem to get the download to work because the only option I get is to "save" the file, not "run" or "open"... Thank you for your help

    Firefox does not have a built-in "Run" option on downloads for security reasons. If you "Run" an item, your anti-virus/anti-spyware may not have an opportunity to fully examine the contents until it is already installed on your hard drive. Result: damage, if infected, is already installed on your system.
    With that in mind, you can install the following add-on, but you accept the risk mentioned above ('''NOTE:''' the developer has not updated this product -- OR any of his other 7 extensions -- to be compatible beyond Firefox 3.6.x; therefore, when you upgrade to a more current version of Firefox, you may lose the functionality of the add-on if the developer does not update it.):
    *https://addons.mozilla.org/en-US/firefox/addon/opendownload/
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.com/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]

  • Enable to  run .exe file which is created from .air file  in windows 7?

    Enable to  open .exe file which is created from .air file which is created from adt command in windows 7 .
    for run .exe file ::
    The user must right click and select "Run as Administrator" for run successfully.
    so How to remove this above permission issue in Windows 7?
    Thanks
    Sunil

    Right-click on the exe file and choose Properties.
    Switch to the compatibility tab and uncheck the box next to "Run this program as an administrator". Click "ok".

  • Where to put files in using runtime.exec(run.exe)?

    I try to use the following program in EJB to call my EXE program in the J2EE server:
    runtime.exec("c:\\j2ee\\public\\exe\\run.exe temp.txt");
    In the execution of mill_turn.exe, it will open several files for read and write.
    So where to put the file temp.txt and other files the run.exe need to read?
    Looks like the J2EE server can not find them?
    Thanks!

    I got it in Java SE1.4.
    File dir=new File("c:\\j2ee\\public_html\\Mill_turn\\exe\\");
    Process proc = rt.exec(cmd,null,dir);Use above codes, I really got the right output from my external program for the first time. But , after that, the output keeps same when I change the filename in the following code:
    cmd="c:\\..\\run.exe temp.prt"
    to
    cmd="c:\\..\\run.exe Abc1.prt" , which must have different output.
    The codes for calling external program are implemented in the SessionBean of J2EE.

  • Please help this: JNLP association extensions confict with arguments

    Hello, Please help this:
    I use <argument> tag to transfer some parameters to JWS application.
    I also use <associatio> tag to associate a specila file(such as .zzz) to JNLP. But when I doulbe click .zzz file, my application only get "-open" and file path as argument, those parameters in <argument> tag in my jnlp are lost!
    What should I do

    ..Is this a bug for JWS? No.
    ..association extensions tag conflicts with <argument>?Quoting the 'JNLP Specification', section 3
    'JNLP file', part 5 'Descriptor Information', under
    association element/mime-type attribute
    "An application making such a request
    should be prepared to have its main
    method invoked with the arguments
    -open filename and -print filename
    instead of any arguments listed with
    the application-desc element."

  • Run EXE from JAVA program

    Does somebody know whether it is possible to run some program with extension EXE from JAVA program?

    Yes sombody knows. Yes it's possible. Have a look at Runtime#exec.

  • How to run exe files using peoplecode?

    How to run .exe extension files using peoplecode. It should execute on clicking a button.can anyone provide sample peoplecode for the same.
    where do i place the exe files ? Local workstation or Server or FTP?
    can i use the same peoplecode if i'm using a button on grid.

    1. You can use function Exec in PeopleCode to run any exe file
    2. You can use ViewContentURL function in PeopleCode to view any .pdf or .doc documents
    Jayaprakash Tedla

  • What is the best way to run .exe files on my mac?

    What is the best way to run .exe files on my mac? I need to run some updates for my john deere gps and the downloads i get can only be run on windows.

    There are several options for running Windows software (*.exe files) on a Mac, depending what your program is, how often you use it, and your personal preferences.
    One way that does not require Windows is an open source effort called WINE.  Check out winehq.org.  You may find that that's all you need for your programs.  There is also a commercial effort that has grown from WINE, and you will find info about it on the site mentioned.  These DO NOT require that you have and install Windows.
    If you want to run sessions devoted only to Windows software, and want programs to run as fast as they do on a PC, the Apple's Bootcamp program is useful.  With it you dedicate a partition on your hard disk to windows, and on startup choose to either boot into OS X or Windows.  Each runs without any connection to the other.  This requires you have a copy of the Windows software as well as the applications you want to run. 
    If you want to be able to easily exchange data between your Windows and Mac programs, and skip back and forth between the two, there are several emulators available that run on Mac OS X and create a Windows environment where many Windows programs can operate along side Mac programs.  Parallels and VMwear are two comercial packages available for purchase and Virtual Box is an open source effort available for free.  Google will find all three for you.
    My only experience is with Virtual Box.  It is slow and a bit clunky, but it is free and meets my needs for the very few "just got to have" windows programs I sometimes use.
    Google is your friend on this and can provide a lot more, and better, information than I can.
    Best of luck,
    Ray

  • Compiled vi always runs when opened, Labview 2013 bug?

    I'm presuming it's not a bug, but right now it looks like that:
    I compile a vi to an exe using the application builder, but no matter how I adjust the settings, the vi will always run when opened.
    I'm running LabVIEW 2013.
    Lars Melander
    Uppsala Database Laboratory, Uppsala University

    The start up vi will run.  This is expected behavior.
    If you want the running vi to wait for user input before executing a process you need to code a proper arcetecture to do that.  Look into the Producer Consumer (Events) design pattern.  It is a good way to start an application like you describe.
    Spoiler (Highlight to read)
    See, asking a question (or at least explaining what behavior you want) gets more specific answers.
    See, asking a question (or at least explaining what behavior you want) gets more specific answers.
    Jeff

  • Error when running Payables Open Interface Import

    Hi Experts,
    I need help. I'm facing a problem when run Payables open interface import. Before that, I was running same concurrent many times and the concurrent program is completed normal. But, when I try again I'm getting error. what exacly problem is? What should I do?
    arguments
    p_org_id='84'
    p_sources='manual invoice entry'
    p_batch_name='N/A,
    p_purge_flag='Y'
    p_trace_switch='N'
    p_debug_switch='Y'
    p_summary_flag='Y'
    p_commit_batch_size='1000'
    p_user_id='1110'
    p_login_id='75025'
    Current NLS_NUMERIC_CHARACTERS Envirotment Variables are :
    American_America.US7ASCII
    Enter Password:
    REP-0004 : Warning : Unable to open user preference file.
    MSG-00001 : (Before Report) After SRWINIT
    MSG-00002 : (Before Report) After Get_Company_Name
    MSG-00003 : (Before Report) After Get_NLS_Strings
    MSG-00001 : (Get Base Curr data 1) Get Base Currency Information
    MSG-00004 : (Before Report) After Get_Base_Curr_Data
    MSG-00005 : After Get Operating Unit
    MSG-00006 : After Get Purge Flag
    MSG-00002 : (Before Report Trigger 1) Import Invoices.
    MSG-00003 : (Before Report Trigger 3) Exception : When Others.
    REP-1419 : 'beforereport' : PL/SQL program aborted.
    REP-0069 : Internal Error
    REP-57054 : In-process job terminated: Terminated with error:
    REP-1419 : MSG-00001 : (Before Report) After SRWINIT
    MSG-00002 : (Before Report) After Get_Company_Name
    MSG-00003 : (Before Report) After Get_NLS_Strings
    MSG-00001 : (Get Base Curr data 1) Get Base Currency Information
    MSG-00004 : (Before Report) After Get_Base_Curr_Data
    MSG-00005 : After Get Operating Unit
    MSG-00006 : After Get Purge Flag
    MSG-00002 : (Before Report Trigger 1) Import Invoices.
    MSG-00003 : (Before Report Trigger
    Best Regards,
    Ade Hilman

    Hi Ade;
    Please check below note which is mention similar error
    Validate AAD fails with ORA-20001: -: XLA-95103: An internal error occurred. [ID 943024.1]
    Hope it helps
    Regard
    Helios

  • Report generation toolkit VI error when running EXE

    A VI inside the Report Generation Toolkit (version 1.1.2), Excel Find Application Directory.vi, will not function correctly when running an EXE.  The "Current VI's path" block will return the path of the currently running EXE rather than the path of the Excel Find Application Directory VI.  (The same would be true for Word Find Application Directory.vi.)
    -Joel
    Solved!
    Go to Solution.

    Have you had a look at this knowledgebase article? The error is caused due to the exclusion of any dynamic VI.
    Ipshita C.
    National Instruments
    Applications Engineer

  • Getting Data From Running EXE

    Hello,
    First off, I am an amateur programmer. I have been programming for a few years now, but because I'm a meteorology major, and not a CSCI major, I haven't had too much time. Tying in the fields of meteorology and computer science, I have made a few programs about the weather.
    There is a radar program, GRLevelX, which displays radar information, much like on television. With hi-tech abilities with it. One of the capabilities is placefiles, which can be added to the program. So what I am trying to do is make a placefile which shows an aerial map from Google Maps, which can be placed under the radar. When I get down to it, I have the code to grab the map and put it int he placefile format, however, the only thing I cant get is the coordinates of the visible window of the program.
    Is there any way I can tap into a running EXE, get variables being used by that program, and have them returned to the Java file I have created so far? I have spoke wiht one other person about this and he said I would need to call Win32 API and get the window handler. Again, I'm very new to this, so that si kind of confusing. But I try to challenge myself with these programs, trying to learn the language a bit more. I have searched through many forums trying to look how to do this, and I can't seem to find anything. Any ideas? Thank you very much! I appreciate any help anyone can provide.
    Chris

    Thanks for the quick replies. After some looking at the program and the first response, it looks like Java isn't the way to go. At least I have a good basis on how to do the main stuff, in java, just have to see if I can hand that off to someone familiar with the program to write in a different language. As for the second reply, I can see what you mean, not wanting to go into any secondary program. Especially if I don't know how its written and whatnot. There are a number of other placefiles, which do go into this program and grab data such as coordinates, and return their values. I will have to see what language they use (Visual Basic, i think?). Thanks again for the replies!
    Chris

  • I want to run an open order report with no goods receipt

    I'm looking to run an open order report with no confirmations(i.e.the order must have no status like LA,Z4,Z5,Z6)and no goods receipt.
    ME80FN is still giving me orders that have no confirmations but closed.
    I tried using a logical database but no luck.
    What can i use to achieve this open order report?

    Hi,
    You can write a small report for this requirement:
    Just select all the PO's from EKKO and EKPO table into an internal table(ITAB) with the given where condition.
    Write a select statement for the MSEG for all entries in ITAB into an seperate internal Table(ITABM).(nothing but all GR's entries)
    Compare Both internal tables and delete all entries which are present in second Int table ITABM from the first.
    That's all.
    The remaining entries are nothing but the OPEN PO's without any Goods Receipt.
    Regards,
    Anji

Maybe you are looking for