LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Application Activation event

LV 2013, Win7

 

I have figured out that the VI DEACTIVATION event occurs when a VI window loses "frontmost" status, and a VI ACTIVATION event occurs when a VI window becomes frontmost.

So, in my app where I have several windows open, if I click on window A, it is frontmost.

If I then click on window B, then a global VI DEACTIVATION event is issued, carrying the details of window A (Name, refnum, Window, etc.), and then a global VI ACTIVATION event is issued, carrying the details of window B.

 

It does not matter if window B obscures window A or not.

 

Any VI that is interested can register for these events, and compare the name or refnum and recognize when their own window is gaining or losing focus, and act accordingly.

 

However, what is the rule for the APPLICATION ACTIVATION event ?

 

As far as I can tell, it is never issued.  Under any circumstances.

 

The help is particularly un-helpful: Occurs when the user activates LabVIEW.

 

What I would expect from that is that it occurs when I click back on (any) one of my VI windows, after having gone and played with Explorer, or some other program.

 

But no.  I cannot trigger that event.

Under any circumstances that I have tried.

 

Any ideas?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 1 of 5
(2,933 Views)

Love this!  I had a Bright Idea -- maybe the Help message is correct and it refers to starting LabVIEW.  So I wrote a little routine that had such an Event, stopping if it fired.  Built an EXE, let it run.  Started and stopped LabVIEW.  No difference.  Oh, well ...

 

Time to Ask Darren ...

 

Bob Schor

0 Kudos
Message 2 of 5
(2,917 Views)

Also, in the "Useless Features" category, I discovered that the VI ACTIVATION event carries a "VIWindow number" that is always zero, and a "VIAppRef" number that is unrelated to anything that I can find, despite the HELP text: Reference to the VI in which this event occurred."

The "AppRef" parameter is always the same as the "VIAppRef" parameter., and is unrelated to the VIs in question.

 

Not quite ready for prime time, it seems.  Maybe improved in later versions?

 

 

 

JING: <https://www.screencast.com/t/lcckhnN9s>

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 5
(2,914 Views)

maybe the Help message is correct and it refers to starting LabVIEW.

 

I thought of that, but why would you need an event to know that LabVIEW started running?

 

I also thought of "activation" meaning "becoming licensed", but that's completely different from the meaning of "VI Activation", and I don't know why that would be useful either.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 5
(2,912 Views)

Well, I was testing in LabVIEW 2016 ...

 

BS

0 Kudos
Message 5 of 5
(2,910 Views)