Jump to content

Determine if LabVIEW is frontmost application


Recommended Posts

How can I determine if LabVIEW is the active (frontmost) application? I know that you can set a VI to be floating and automatically hide when LabVIEW is not active. But is there any way to access that information via an event or property node? If I had a floating VI, I could check if it was hidden or not -- but to make it interesting let us assume that is not an option.

On a side note, I tried the scripting event for "Application Activation" but I couldn't even determine what event causes this to fire.

David

Link to comment

QUOTE(JDave @ Mar 5 2008, 03:41 PM)

How can I determine if LabVIEW is the active (frontmost) application? I know that you can set a VI to be floating and automatically hide when LabVIEW is not active. But is there any way to access that information via an event or property node? If I had a floating VI, I could check if it was hidden or not -- but to make it interesting let us assume that is not an option.

David

In the user32.dll there is a SetWindowPos function that can be used to make the window the frontmost. I didn't see a get or query counterpart in a brief search, but that would be the place to look.

Tim

Link to comment

QUOTE(TobyD @ Mar 5 2008, 03:50 PM)

Thanks.

I was really hoping for a platform independent solution, but in talking to NI it appears that they also use the OS API to hide and unhide their floating windows. So this seems the way to go. Thanks again.

David

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.