12-22-2009 01:17 PM
Is there is property or method that will return whether or not a specific VI is the active (has focus) window?
Thanks,
Cristian
12-22-2009 01:28 PM
12-22-2009 04:25 PM
12-23-2009 07:19 AM
hmm...I created a simple example to test this and the boolean stays false even if the front panel is active. I'm using LabVIEW 9.0f2 if that makes a difference...can someone verify the behavior of this in another version (set VI to floating).
12-23-2009 07:53 AM
I don't have LV9 but are you sure that your reference is right "This VI". If you target the current VI, let the 'reference' connector empty.
If you are not sure link the 'error out' cluster to check that the reference is not empty.
12-23-2009 07:56 AM
I just noticed that on the code snippet. I do have a constant VI reference connected to the property node, for some reason it made it a control when I created the snippet.
12-23-2009 08:07 AM
Ok.
Test without constant ref or check it's not a 'Not a Refnum'
Do you use special settings as VI properties? Dialog, reentrant, ...
Think also to the error cluster.
12-23-2009 08:13 AM
12-23-2009 08:18 AM - edited 12-23-2009 08:20 AM
(That's just the way code snippets work, nothing was done wrong)
back on topic:
In LV 8.2, the code "works", i.e. @ Floating, Frontmost = True
In LV 8.5, the code does not work, i.e. @ Floating, Frontmost = False.
I noticed in the Help re: Floating behavior, something was changed in 8.5. It says Focus will not immediately be relinquished when a floating window is selected (or something like that) and 8.2 does not mention that.
12-23-2009 08:24 AM
Ok, I didn't see that you use floating window.
It's explicity specified in the help that the function is ignored for floating windows.
Property of VI.
Indicates whether to bring the front panel to the front. This property applies only in the application instance of the calling VI.
If TRUE, LabVIEW brings the front panel to the front. If FALSE, the VI does nothing. If you read this property, it indicates whether the front panel window is the front window (ignoring floating windows).