How to detect the change of focus between applications

LV2013, Win7

I have a long operation that so I have to.  Let's call it a "scan".

I start to a particular folder on the disc and look for files within this framework and in those folders, etc.  I am looking for a particular file (*.lvlibp).  When I find one, I need to open it, look for particular screw it contains and check them for executability (broken) and fix the ConnPane, etc.  I put all the elements of qualifications in a menu (in the menu bar) as the submenus and submenus, etc..

I do the scan in a separate thread, is not as if I'm blocking anything either, but it takes away CPU time that I would rather not use.

If I do the scan only once, then the user can go to the Explorer, move a file in place, or rename a folder and come back and I miss the changes.

Right now, I do whenever the single window happens (the one to which applies the menu).  But this means that round in my application of switching windows causes the scanner again, when there is no chance of a new file that appears.

I would like to do this scan only when it is necessary, that I define as when I come back from another program (WIndows Explorer for example) this single window in my LabVIEW application.    I am ready to accept the fact that Scripts Windows or remote operations may sneak a file in there.  I don't mean to be bulletproof, just accommodating the more common scenarios.

I don't want to make a kind of vote - the entire application is event-driven, and I want to keep it like that.

So, how can I do this?

If I look at the ACTIVATION VI event, it looks like it happens for ALL VI have activated.  I can attach a name-comparison and detect when the right window is coming forward, but again, simply because this window comes forward does not mean that I need to analyze.

If I look at the event of ACTIVATION of the APP, it seems to be NEVER called. Even in an EXE file, the event seems never to occur.

If I had an event to DISABLE the APP, I could set a flag when it happened, and the next time that the right window comes up, I could check the indicator and scan if necessary.

But I did none of this case.

Any ideas on how to do this?

I think what I'll do is just watch the LAST MOD TIME of the parent folder.

When I do a scan, I hide the LMT of the parent.

Then, whenever the WINDOW is enabled, I'll check the LMT to the case against my hiding place.

If it is different, then I scan again.

Check the LMT takes about 50 uSec on my system, a relatively small price to pay.  And I do it when the window comes up to the top, so I will not notice every little detail of what you do, and I don't have to dig into .NET and assemblies and versions and unnecessary and other error messages.

Tags: NI Software

Similar Questions

  • How to detect the upgrade of our own application

    Hi, expert,

    We use the CodeModuleListener to detect any deletion of the application and the addition. If our request is deleted, we get the removal of module for our own application, then we'd work dé - a correct initialization. However when our application is upgraded, we would get the deletion of the module for our own application as well, so we would trigger of - initialization, falsely, that is really not desirable.

    Right now, we allow the upgrade through our own UI instead of the browser as our own UI upgrade would be made necessary by a specific menu and we know that an update will happen.

    However the upgrade via browser, we do not remove current module comes from our application upgrade or remove our application by users. Just wonder if there is anyway to detect our own upgrade of the application.

    Furthermore, permanent storage objects are not deleted during upgrade of the application and will be removed during the removal of the application, which is the expected behavior. It's just, there are some extra that we have informed our server during the removal of the application.

    Hi fold.
    It seems that now I am being misunderstood...
    I wanted to say that you must create a new application that will install your original application and the download link would point to the new application.
    In this way, users will download the new app (the Installer) and he will decide that this is a new installation or an upgrade for your initial application.

  • How to detect the change in the value of the point?

    Hi all

    We want the list of all the goods that the customer chooses, TileList is used to display all the information about the goods and a custom component MyItem is used as ItemRenderer. Meanwhile, a tag is used to display the sum of all the goods. The hierarchy is simply like this:

    <? XML version = "1.0" encoding = "utf-8"? >
    "< mx:Application xmlns:mx ="http://www.adobe.com/2006/mxml"layout ="absolute">"

    < mx:TileList id = "tl" dataProvider = "{acGoods}" ItemRenderer = "MyItem" / >

    < mx:Label id = "labelSum" / >
    < / mx:Application >

    Here, acGoods is an ArrayCollection collection which I believe may be linked.

    The user can change price in MyItem directly, so no need to update the text of the label as well. I find that acGoods contains the last price. Now the problem is the text of the label remains the same. I tried to call the calculation function in set acGoods(), but it does not work.

    Please don't not event expedition sugguest because this is a simplified scenario based on only. If someone tell me how to implement this in conjunction fluxhing, it'll be very useful.

    Best wishes

    protected function get totalLabelText (): string {}

    for each i: var * in acGoods and so on

    return 'label calculated here;

    }

    MyItem Inside:

    Once you've changed something to invoke:

    Application.application.executeBindings (true);

    Hope it will work for you

  • How to detect the key ALT pressed in os7

    Hai,

    How to detect the key ALT pressed in Os7...

    Can I use the source for os 7 as below? ,

    protected boolean keyStatus (int keycode final, time final int) {}

    If (Keypad.key (keycode) == Keypad.KEY_ALT) {}

    ...

    Returns true;

    } else

    Return super.keyStatus (keycode, time);

    }

    and also I want to know which is the return of this method? In detail
    How to detect the other touches also?
    What are the updations or changes in the code, on os6 os7?

    KeyCode is a bit model, if you use "is" to compare you won't get accurate results, you should use the operator '& '.

    See
    http://supportforums.BlackBerry.com/T5/Java-development/detect-ALT-and-shift-key-clicks/Ta-p/444976

  • How to make the difference in percentage between two matrices?

    Hello everyone, I just want to ask how to make the difference in percentage between two binary matrices. This is to compare two images converted to matrices in LabView. Thank you.

    Well, in the current image interesting pixels are zero in the reference image. Here is a small example that would take all the zero 100% pixel, then look at the pixels of same in the other image to see how are always 0.

    Modify if needed.

  • How to detect the window closing event and to do some tasks before leaving

    Hello

    Someone knows how to detect the window closing event and to do some tasks before leaving?

    Sridhar

    Structure of the event allows to detect the window closing event. In the structure of the event,.

    Select this VI-> close round table for this task. See attached picture.

  • How to detect the sign of a number?

    I output which gives the number of negative or positive. My problem is how to detect the sign of the Boolean number and output? For example if the input number is negative as - 23.11 I want to output the value false and if the number is positive as 17.99 I want to output true.

    T H A N K S!

    Test if the number is greater than or equal zero.

  • How to get the changes during the process of replicat ABENDED

    Hello
    I'm working on Oracle GG two-way DML replication. I m stuck in one place.

    My target replicat process has been ADDED due to the error:-ORA-01403: no data found. I restarted my process replicat again by runing the below command

    GGSCI (db1) 30 > replicat rep2 alter now
    GGSCI (db1) 30 > start replicat rep2

    After the reboot, the process to replicate that I do not see the changes on the target server which I had applied on the source for replicat target server was ABENED.
    My doubt is.

    1. is my command is correct for start replicat ABENDEND process?
    2. how to get the changes to the target server that applied to source for replication targer ABNDED?
    3. how to avoid the process of ABENDED replicat on the production server?
    4. how to follow the process in the production server ADDED?

    Please HELP:)

    Published by: Sabrina on August 29, 2012 03:32

    info from the GGSCI prompt will tell you the current file path and RBA.

    With this information, you can go in logdump and follow these steps:

    open 
    detail data on
    pos 
    n (next)
    

    It will appear the RBA # the next transaction. Then you return to the GGSCI prompt and do:

    ALTER EXTRBA
    BEGINNING

    With that he will take this next RBA from until you reach the following 1403

    Greetings,
    NACEUR

    PD: in the case where your question is answered please remember to mark your answers questions in order to clean up the forum and help others when they are looking for solutions to their problems.

  • How to detect the number of created quickobjects

    How to detect the number of quickobjects created? quickobject are quickbox2d.

    Basically, I have a timer that will countdown to 4 seconds and it will create a falling ball, it will get removed when she falls down. However, I want only there so that if more than 5 bullets are in step, it will cease to create until it is less than 5 to start creating some balls again. Is there a way I can do?

    It's the timer to create the ball

    If (! _ballCreation_timer) {}

    _ballCreation_timer = new timer (4000);

    _ballCreation_timer.addEventListener (TimerEvent.TIMER, _onBallCreationTimer);

    }

    _ballCreation_timer. Start();

    Function which create the ball based on clock

    function _onBallCreationTimer (e:TimerEvent): void {}

    _doCreateNewBall();

    }

    function _doCreateNewBall() {}

    _ball_quickobject = sim.addCircle ({x: PHYSICS_SCALE * (960), y: PHYSICS_SCALE * (10), RADIUS: 0.5, draggable: false});

    MAKE A LIST OF BALLS

    _balls_array.push (_ball_quickobject);

    }

    This is the part where if the table (QuickObject) ball falls down and are destroyed

    addEventListener (Event.ENTER_FRAME, _onEnterFrame);

    DRAW EACH BALL FALLING OUT OF THE SCREEN

    function _onEnterFrame (aEvent: Event): void {}

    for each (var quickObject: QuickObject in _balls_array) {}

    BALL FALLING OUT OF THE SCREEN?

    If (quickObject.y / PHYSICS_SCALE > 1080) {}

    _doHandleBallOffScreen (quickObject);

    }

    }

    }

    DESTROY THE BALL FALL OFF THE SCREEN IF

    function _doHandleBallOffScreen (aQuickObject: QuickObject): void {}

    DESTROY THE OBJECT

    aQuickObject.destroy ();

    REMOVE FROM THE CUSTOM TABLE

    _balls_array.splice (_balls_array.indexOf (aQuickObject), 1);

    }

    check the length of _balls_array.  If it is greater than 5, do not create another bullet:

    If (! _ballCreation_timer) {}

    _ballCreation_timer = new timer (4000);

    _ballCreation_timer.addEventListener (IMER TimerEvent.T, _onBallCreationTimer);

    }

    _ballCreation_timer. Start();

    Function which create the ball based on clock

    function _onBallCreationTimer (e:TimerEvent): void {}

    _doCreateNewBall();

    }

    function _doCreateNewBall() {}

    If (_balls_array.length<>

    _ball_quickobject = sim.addCircle ({x: PHYSICS_SCALE * (960), y: PHYSICS_SCALE * (10), RADIUS: 0.5, draggable: false});

    MAKE A LIST OF BALLS

    _balls_array.push (_ball_quickobject);

    }

    }

    This is the part where if the table (QuickObject) ball falls down and are destroyed

    addEventListener (Event.ENTER_FRAME, _onEnterFrame);

    DRAW EACH BALL FALLING OUT OF THE SCREEN

    function _onEnterFrame (aEvent: Event): void {}

    for each (var quickObject: QuickObject in _balls_array) {}

    BALL FALLING OUT OF THE SCREEN?

    If (quickObject.y / PHYSICS_SCALE > 1080) {}

    _doHandleBallOffScreen (quickObject);

    }

    }

    }

    DESTROY THE BALL FALL OFF THE SCREEN IF

    function _doHandleBallOffScreen (aQuickObject: QuickObject): void {}

    DESTROY THE OBJECT

    aQuickObject.destroy ();

    REMOVE FROM THE CUSTOM TABLE

    _balls_array.splice (_balls_array.indexOf (aQuickObject), 1);

    }

  • How to detect the color pages in a PDF file?

    I use a plug-in of Acrobat C++ read/modify a PDF file.

    I need to get the total number of pages in the PDF file and the page numbers of the pages in color.

    So far, I was able to get the total number of pages using PDDocGetNumPages() with no problems.

    However, I can't find an API that lets me know if a particular page is color or not. Is there a way to do this?

    Thanks in advance!

    But what happens if there are RGB data which means black or grey (R == G == B), that means black or RGB?

    There is a code sample in the SDK to browse content in the PDF file, and then you can get the color space and color of each object.

    But you really need to do background research on the colors & spaces to achieve this properly.

    From: Sachintha81 [email protected]<>[email protected]>

    Reply-To: "[email protected]<>[email protected]> ' [email protected]<>[email protected]>" "

    Date: Wednesday, February 8, 2012 16:57:10-0800

    To: Leonard Rosenthol [email protected]<>[email protected]>

    Topic: How to detect the color pages in a PDF file?

    Re: How to detect the color pages in a PDF file?

    created by Sachintha81http://forums.adobe.com/people/Sachintha81> in Acrobat SDK - see the discussion complete onhttp://forums.adobe.com/message/4194889#4194889

  • How to detect the operating system to PDF using javascript

    Hello

    How to detect the operating system to PDF using javascript. (Javascript console)

    Thanks in advance.

    App.Platform will return "WIN", "MAC" or "UNIX".

  • Can I turn off the change of focus from one object to another?

    Hello.

    I have a game where i control a MC with the arrows on the keyboard, when I click outside of the application flash and back in the MC loses focus. The focus moves to a button in the scene. What I have observed, is that Flash Player has a built-in control, which moves the focus from one element to the other with the arrow keys.

    Is there a way I can disable the change of focus from one object to another?

    Thank you.

    Why you need such a thing...

    Is it true that you lose the focus of your video clip and that's your keyboard listeners do not work?

    And you want to work.

    For this situaton I ideally add my Council key on the stage event listeners and the rest of the creation of the logic accordingly.

  • How to disable the change (the value read-only) on an editable Table cell?

    Hi friends
    How to disable the change on an editable on certain conditions Table cell?
    are there example links?
    concerning

    Published by: sak on December 22, 2009 11:28

    No, in the apex_item attributes for example

    select
      APEX_ITEM.CHECKBOX(1,empid,nvl(empid,'readonly')) test
    from emp
    

    Shunt

  • How permanently increase the font size in windows applications

    How permanently increase the font size in Windows applications as for example the mail application? The letters are much too small, and my eyesight is perfect! Thank you

    Sign of salvation,

    Welcome to the Microsoft community forum. From the description of the problem, it seems that you want to change the font size for the user interface modern app.

    You can change the modern user interface text size by going to the charms > settings > change the settings of the PC > PC and peripherals > display

    Also see this Microsoft article:

    http://Windows.Microsoft.com/en-us/Windows-8/make-text-screen-larger-smaller/?v=t

    Windows 8.1, you can now set the DPI (Dots per Inch) scale to make text and other items, such as icons, fonts and windows, to more or less important for all display or by display screens.

    Windows 8.1 DPI scale improvements are mainly focused on:

    • Optimization of ergonomics and the readability of displays high-resolution
    • Offering an experience uniform multi-screen systems
    • Give developers optimize app specific scale based on display DPI

    If you are using a resolution of 1366 x 768 display on a shelf, chances are that UI will look good 100% ppp settings. But what about when you connect the tablet to an external high resolution? In Windows 8, you can choose either 100% in order to optimize the user interface on the screen of the tablet or display up to 150% in order to optimize the user interface on the outside. You have to make compromises.

    8.1 Windows takes care of this issue pressing address scaling of IPR by display . By default, Windows 8.1 will choose the optimal DPI scaling value for each display based on the value selected for the global scaling in the control panel.

    You can also view the suggestion provided by Shawn on this thread.

    http://answers.Microsoft.com/en-us/Windows/Forum/windows8_1-ECOMS/how-does-one-increase-the-size-of-the-text-of/58c7f3fe-8686-4422-ad36-8ab75515527f

    I hope this helps. If you need help with Windows, let us know and will be happy to help you.

  • How to show the multiple declaration for an application

    How to show the multiple declaration for an application

    Thanks for your suggestions...

    Looking at the javadocs you can only save an indicator by application. You will need to do three separate applications and package them as an If you want three different indicators to be visible at a time. Or change the flag that (or which group) of the indicators you want to display.

Maybe you are looking for

  • PDF, Zoom and passwords

    Hello, I use a MAC 10.6.8 and since I installed the latest version of Firefox (11.0), I face the following questions: -I can't open PDFs more via internet (after a search on Google for example)-The 'zoom manual key' does not work (and it worked)-If I

  • Pavilion s3100n: upgrade memory ram

    Two weeks ago, I got my backup to restore the system in the mail, I installed .i have windows vista 32 bit so I installed windows 7 64 bit and works only question is my ram memory says I have 1.00 GB(895_MB_usable).my question can I upgrade my ram 1.

  • pulse width modulation

    What modules or do I need to acquire signals from an LVDT? I have an analog output, but is there another required module?

  • Windows media player I can't find a way to remove photos, or download it to a flash drive

    I have a bunch of pictures I want to get off Windows Media Player and I can't figure out how do it.

  • Want to 4500 Ink Instant stats not updated on the HP website

    I had a craving for 4500 in August and is part of the instant the ink drawing, but the stats on the site for ever day. I click on the button refresh it but it still shows zero pages printed. He never contacted the printer successfully since the initi