LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

controlling on exit

I am developing an application where I have put exit under the file menu. When somebody wants to exit, I then ask if they want to save their data.

People also want to be able to close the program with the normal windows exit box in the upper RH corner. Is there a way that if they click the X (I currently have disabled), that I can then prompt to see if they want to save data first?

Thank you.
0 Kudos
Message 1 of 5
(3,124 Views)
Use a filter event (This VI..Panel Close?) and wire the outcome of your confirmation dialog to the "discard" terminal. (See attached example).
0 Kudos
Message 2 of 5
(3,124 Views)
With LV 7 (and probably 6.1), you can use an event structure to capture and
control the Panel Close? or Application Exit? events. You can discard the
default handling and write your own.

> People also want to be able to close the program with the normal
> windows exit box in the upper RH corner. Is there a way that if they
> click the X (I currently have disabled), that I can then prompt to see
> if they want to save data first?
0 Kudos
Message 3 of 5
(3,124 Views)
I don't think its possible to do it in 6.1, I've used 6.0 and you cant easily. But you could catch the window messages and parse the
messages before the application exits.
look for windows message queue library on the NI site.

Cheers

"Eyecheck2003" wrote in message news:50650000000800000068D60000-1079395200000@exchange.ni.com...
> I am developing an application where I have put exit under the file
> menu. When somebody wants to exit, I then ask if they want to save
> their data.
>
> People also want to be able to close the program with the normal
> windows exit box in the upper RH corner. Is there a way that if they
> click the X (I currently have disabled), that I can then prompt to see
> if they want to save data first?
>
> Thank you.
0 Kudos
Message 4 of 5
(3,124 Views)
Martin Riddle wrote:
> I don't think its possible to do it in 6.1, I've used 6.0 and you cant easily. But you could catch the window messages and parse the
> messages before the application exits.
> look for windows message queue library on the NI site.

See the previous post from Altenbach. It can be done in LabVIEW 6.1 with
the event structure. The event structure is a new feature in LabVIEW 6.1.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 5 of 5
(3,124 Views)