Quiting applications gracefully from within LV

Hello,
Attached is an example VI that can be used to open and close a third party application. It does this using the System Exec vi and the windows comand line 'tskill'. The VI will prompt the user to go back to the application and save any changes.
Is there an alternative comand line or method which will close the application gracefully, so it asks the user to save changes directly (the same as when the application is quit manually or it is closed by windows shutting down)?
I am using XP sp3 and LV 8.6 (not very familiar with Windows comand lines etc though).
Thanks,
Blue 
Attachments:
Open close app from LV example.vi ‏24 KB

Hello smercurio thanks for that link, very welcome! i have spent the last couple of days searching for something like that with no success. It contains the building blocks to do what i need.
The comments below are so that hopefully some other nubie will come across the solution more easily than i did... (as search terms are easy once you know them - eg searching the forum for user32 and lvutil32 gives me no hits).
How to begin to interact and manipulate with third party applications and windows from a LabView VI.
The 'Call Library Function Node' alows LV to communicate with .dll (dynamic link library) files.
The Windows API .dll for interacting with desktop windows is called 'user32.dll'
Examples of LabView VIs calling user32.dll can be found in Lvutil32 at:
http://zone.ni.com/devzone/cda/epd/p/id/2556 
The VIs in Lvutil32 use both user32.dll and lvutil32.dll.
User32.dll is part of Windows.
Lvutil32.dll is not part of windows and will need to be included with any VIs that call it. 
For VIs using windows command lines to launch applications it is necessary to include the full path to the application. Obviously moving the application from the path will cause an error. Alternatively you can edit the 'Path' entry in Control Panel > System Properties > Advanced > Environmental Variables > System Variables > Path to include the path to the application to be launched. This will mean that only the name of the application executable is needed.
A great VI for experimenting sending simulated key strokes to the active application is Virtual Keyboard.vi posted at the link below by Peter (though you may need to reduce the 'Delay' input).
http://forums.ni.com/ni/board/message?board.id=270&message.id=839&query.id=2019#M839 
Comments, additions and corrections welcomed.
Thanks again for the support, Blue 

Similar Messages

  • Is it possible to change application state from a component?

    I was wondering if it is possible to change application state from within a custom component and if so, what would the syntax be if I had an application named "zzz" and I wanted to change the app state from "state1" to "state2" from my component?
    Thanks!

    Hi,
    you always have a static class Application.
    Application.application will be the root component. After that you can change it state.
    Application.application.currentState = "state2";
    But it's not the best way to change states. It's better to dispatch events from components and change states in listeners.

  • Changing states from within a component

    Let's say that I have a TileList that is rendering data in a
    VBox. Eventually the TileList fills up and starts scrolling. I want
    to change states when clicking on item in the TileList.
    I don't want to place the click-attribute in the TileList,
    because it will change states when I am scrolling the list without
    actually selecting anything.
    I want to say click="currentState='state2'" inside the VBox,
    but that does not work because state2 is at the root level, and I
    don't know how to get to the root-level (in lack of a better word)
    from withing the component.
    This is not the proper syntax, so misunderstand me the right
    way here... Is there an equivallence to
    click="currentState='_root.state2'" in mxml?
    Thanks for any suggestions or best practices. I want the easy
    way out.
    This is the general structure...
    <mx:Application>
    <mx:states>
    <mx:State id="state1"/>
    <mx:State id="state2"/>
    <mx:State id="state3"/>
    </mx:states>
    <mx:TileList dataprovider="{...}">
    <mx:itemRenderer>
    <mx:component>
    <mx:VBox id="ClickThisBoxToChangeStates">
    <mx:Image/>
    <mx:Label/>
    </mx:Vbox>
    </mx:component>
    </mx:itemRenderer>
    </mx:TileList>
    </mx:Application>

    Your assumption is right.
    It doesn't work because there is no state2-state defined
    within the mx:component.
    In the documentation about changing states it says that I can
    go from application level and change states within a component;
    like this: click="currentState='mycomponent.anotherstate'" but not
    how I can change a state at application level from within a state.
    When I try, it says (at runtime) that the state is not defined.
    So I don't know why <mx:VBox
    click="currentState='state2'"/> doesn't work.
    I apprechiate your expertese a lot.

  • Launching an installer from within Air on MAC

    Hi,
    We have an AIR application and from within it we want to download a dmg, mount it and then launch the installer. Is this possible?
    Thanks Claire

    You will need to use the native installer to run your app in extended desktop mode.  Normal AIR apps don't allow you to launch another process.

  • Email from within iPhoto '08 (7.1.1) quit working

    I am running Leopard (10.5.1) and iPhoto '08 (7.1.1) on a 2.4ghz 17" MBP. Whenever I try to email a photo from within iPhoto it pops up a window to let me choose size & options, I hit the Compose button, it will then popup a window saying that it is Preparing photos for email... then that window just goes away and it never creates the new email. I see this same behavior regardless of whether or not Mail is already open and regardless of what photo I am trying to email. This was working fine in the past... believe that it quit working after the upgrade to 10.5.1 (but not absolutely positive of that)... Any troubleshooting ideas would be greatly appreciated as I use this feature quite often.
    Cheers!
    Kirk

    Kirk:
    Try deleting the iPhoto preference file, com.apple.iPhoto.plist, that resides in your User/Library/Preferences folder. Next, if needed, download and run BatChmod on the iPhoto Library folder with the settings shown here, putting your administrator login name, long or short, in the owner and group sections. You can either type in the path to the folder or just drag the folder into that field.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Start a BO report from within a web-application.

    Hi,
    An enuser want to start a BO report from within a web-application.
    The BO report ideally should not prompt for a login. The fact that we are using BO for reporting purposes should be transparent to the end users. The report should produce its output directly in Excel (pdf?) format. In WebI i can do a 'Save As' to obtain this, but it should go automatically so that the end users get their response directly in Excel
    the report should be parametrized. These parameters will be added to the URL by the calling application.
    To do a basic test of the Opendocument.jsp i created a number of test reports in WEBI, and i use the following URLs to execute them directly
    http://s-olaf-vtst150:8080/OpenDocument/opendoc/openDocument.jsp?&sPath=[My reports]&sDocName=tmsd1&sType=rep&sRefresh=Y
    http://s-olaf-vtst150:8080/OpenDocument/opendoc/openDocument.jsp?&sPath=[My reports]&sDocName=Yearselection&sType=rep&sRefresh=Y&lsSYear:=2002
    So this covers points 1 & 4
    What are the options for points 2 & 3?
    Kind regards,
    Johan

    The BO XI 3.1 environment works quite well now.
    Two more questions:
    1. When a user being member of the Readers group, still sees the Edit button in Webapplication - Infoview. Is it possible to hide or disable that Edit button ?
    2. Is it possible to make a user only seeing a part of the data in the universe ? When a query is run with a parameter, the user ses the parameter in the left column ... but in that way a normal user can change the value of that parameter giving him the possibility to see things he should not see. Making a separate query per user is overkill and too much work to do. Is BO XI 3.1 able to offer this possibility and how ?
    Rgds,
    Johan

  • Start a WS application from within a java program

    Hi,
    I need to start a WebStart application from within a java program. Therefore I develeoped a class which starts javaws.exe within its main-method like this:
    try {
    Runtime.getRuntime().exec(
    "c:\\java web start\\javaws.exe http://a.b/c.jnlp"
    } catch (Exception e) {
    e.printStackTrace();
    And that did not work. Java Web Start tries to start the .jnlp program but returns with the message, that the app-desc|applet-desc|installer-desc|component-desc is missing. But it is there: It is an applet and thus I defined an applet-dec.
    I tried to do it from a command line with the followinf command:
    java -Djnlpx.home="C:\abc" -cp "C:\abc\javaws.jar" com.sun.javaws.Main http://a.b/c.jnlp
    And that works. But using this command from within my jjava prog using the Runtime.exec() method does not work.
    By the way, simply type "javaws http://a.b/c.jnlp" at the command line does not work.
    Can anybody help me? How may I start a .jnlp program within another java program.
    Kind Regards,
    Tobias Neubert

    Hi,
    I recently had a quite similar problem. At least the error message by the Java Web Start application on Mac OS X complained about the same error (app-desc|applet-desc|installer-desc|component-desc). It turned out to be some bad invisible characters in the jnlp file. I copied some sample from a web page which for some reason contained some unicode chars that the parser doesn't like. Use a different text editor or the less command on unix to see if there are some strange characters in you jnlp file.
    But it seems strange that it does work from the command line and not from your code.
    -Stefan

  • Send email from within apex 2.1 application

    Hello,
    I like to send email from within apex application. I use oracle 10g xe with apex 2.1
    thx for advice
    Edited by: wucis on Feb 27, 2012 11:49 AM

    That is a very old version indeed. The documentation for sending emails from Apex 2.2 is here:
    http://docs.oracle.com/cd/B31036_01/doc/appdev.22/b28550/advnc.htm#BABJHJJF

  • Unable to open CS3 Files from within the application

    Good Afternoon
    I work as IT Support for company looking after 10 ADOBE Creative Suite 3 end-users.
    One of my colleagues is unable to open Illustrator or Photoshop files from within their respective applications, but she is able to open them from outside ok.
    I have reinstalled ADOBE CS3 and this appeared to resolve the issue, only for it to return again a day later.
    She has no other applications or processes running during her attempt to open a file from within CS3.
    She will click on Open and the 'Open File' window will flash up for a split second, then the whole application will be frozen. It is as if the 'Open File' window is there, but isnt there because we cant click on it, but the application thinks it is displaying and so she can not click on anything else. The only way to close the application is to end the process under Task Manager.
    While I am sitting here tearing what little amount of hair I have on my head, can anyone point me in the right direction?
    Is this a Windows problem or an ADOBE problem do you think?
    I look forward to any replies.
    Thank you

    Hi Bob
    Ok...
    Opened illustrator but was unable to open the 'Open File' window.
    Changed the screen resolution, it suddenly worked!
    Changed the screen resolution back to as it was before, it also worked.
    What could cause this do you think?
    By simply changing the screen resolution and back again, the 'Open File' window displayed itself.
    Very bizarre!

  • Export and Import a page from one application to another within same WKSPCE

    Hello,
    Can anyone help me out in moving a page from one application to another within the space workspace. I tried to export it and then import the page, but I am not able to do that. I think the problem is with the application IDs.
    Plz help me out with this issue.
    Thanks,
    Orton

    Hi Orton,
    moving a page from one application to another within the space workspace
    This U can get it, through copying the page from one application to another application within the same workspace
    In the top of the page, you have "copy" option.
    regards,
    Kavitha

  • Calling a webservice from within Bex Web Application Designer

    Hi
    I have a web-template built with BEx web application designer which also contains textboxes. This text should be stored by calling a webservice (standard BI-documents are not an option).
    Can anyone tell me how I could call a webservice from within the BEx web template to store the text contained in the textbox? The webservice-call should include some of the filter-varialbes of the web application.
    Is this only possible by the use of a JavaScript WebItem? If so - does anyone have an example of such a JavaScript.
    Thanks a lot in advance.
    Kind regards.
    Christoph

    Thanks for your response. The BSP page would work out fine if I only needed to save the data.
    But the next time I call the webtemplate, the textarea should be filled by another webservice call with the stored text (so the text can be modified und saved again). This will not be possible by calling a BSP page.
    Do yoiu have any suggestions how to integrate the text (return value from the webservice call) into the textbox in the webtemplate?
    Kind regards.
    Christoph

  • Timecapsule - opening files from within an application!!

    I have a time capsule... 500Mb
    I have an airport extreme with external hard drive - 250 Mb.
    Through Finder, I can place files on either of these drives and open them from Finder.
    If I open Numbers, or Pages, then try to open any file on Timecapsule, it appears that there are no files
    If I open Number, or Pages, then try to open any file on the Airport Extreme external disk - it works!
    Simple question really.... why cannot I see or open any file from within an application that resides on Timecapsule?? It's driving me crazy!!!
    Message was edited by: GrahamDurkin

    File dialogs have the ability to "group" items, which prohibits you from changing sort options.  The group icon looks like six little squares.  Click on it and instead of grouping by date, group by "none" and then you can change sort orders.

  • I am having issues with Sidebar files not appearing from within InDesign CS5.5. They show up fine from other Adobe applications. Using OS10.6.8.

    I am having issues with Sidebar files not appearing from within InDesign CS5.5. They show up fine from other Adobe applications. Using OS10.6.8.

    I would first of all trash the preference file for InDesign, make sure the application is closed then find the prefs in
    /Users/USER NAME/Library/Preferences/Adobe InDesign and just throw the entire folder away, it will generate a new one after you launch InDesign again.
    Now launch InDesign and see if the problems are resolved.
    If not I would repair your permissions on your hard drive wih disk utility, and if that fails then di-install InDesign and re-install that single application.
    Let me know if any of these suggestions work for you
    I will be checking my email although you might have to wait for a response as I will be taking a microlight flight over the Victoria Falls tomorrow. Yay can hardly wait.

  • Permissions problems, keep changing and can't save from within application

    Hi there, we're running Mavericks server on our local network with a half dozen MBP and iMacs connected.
    For a wee while now, our users have been getting permissions problems. Documents (Excel documents, InDesign, Photoshop etc.) are becoming read only and we can't save them to either the same folder from within the application. Even ones that the same user has created. The thing is, we can copy the document to our desktop and then back again to the same folder and continue to edit and save normally.
    I've tried setting the Access for our "Group" to "Read & Write" but to no avail, this keeps happening. I can login to the server as admin and correct the permissions but they seem to keep reverting somewhere along the line...
    Apologies if there's something obvious I'm overlooking.
    Any recommendations? Would you recommend just removing all users and groups and starting again? Am I missing something?

    Thanks Linc, I have selected the folders that are shared from the Server App "Storage" tab and made sure the permissions are correct and then "propogated" them.
    All users belong to the same group we call "material".
    Just wondering, should I do this sort of thing when no one is connected to the server? Or should I require that everyone log off and back on?

  • Report Execution from within Java application

    I am currently running my Oracle reports through a Java application where I just create a HttpURLConnection to the reports server and push in my report request, and then read the connection input stream in order to obtain the generated report. This is working without too many problems except that in some cases where the report is generated but the application does not seem to understand the reponse.
    I see that there is in fact a Java API available for the reports. Is it possible to integrate this into my application in the same/similar way as I am doing now? If so, where can I get the associated docs as the supplied Javadocs are not too explicit.
    Thanks
    Justin

    You'll have to write a custom ClassLoader to do this - modifying the existing ClassPath from within the JVM just isn't possible.

Maybe you are looking for

  • Still having trouble with iTunes movie rental

    Running a Mac w/iTunes 7.6. It brought down the whole movie, but just as it's about to finish, I get an error that says "We could not complete your iTunes store request. An unknown error occured (5103). There was an error in the iTunes Store. Please

  • Can I save photos from iPad that I edited to my main computer?

    If I edit pictures on iPad can I then get them back in the edited for to my main computer. Their seems to be lots of photo apps but don't want the final pics just for my ipad would also want them in my main computer.

  • IFRS StarterKit - Error in RefreshSheet

    Hi all, We have downloaded and restored the IFRS starterkit to have a look at some of the reports and see how certain things are handled. Unfortunately, it is not really working. We can log on with the admin module, we optimized all applications, pro

  • Importing Illustrator eps files.

    When I import Illustrator6 eps files into InDesign the graphics look incomplete, like they need to be re linked.  Why is this happening and how to fix?

  • I messaging not working 18 november 2012

    I messaging isnt working and hasnt been for a couple of hours now. Down the normal reset phone turn it of then on etc but still isnt working. Have apple got a problem with i messaging x