LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

WM_CLOSE, WM_QUIT and the "X" button - How do I intercept the "X" on the title bar?

Hey, I'm using the Window Mesage Queue library that NI provides, and I'm trying to get it so that when you hit "X" it asks you to confirm that you'd like to close the program.

The problem is, I don't know which message is that "X" button.

I've tried x0010, and x0012, which are WM_CLOSE and WM_QUIT respectively. x0011 is for shutting down the computer, so I know it's not that one.

I think that perhaps it is either x0010 or x0012, but the "X" sneaks through and Windows takes care of it before LabVIEW has a chance to do anything about it.

Does anybody know how to do this?

-Dobbs
0 Kudos
Message 1 of 4
(3,414 Views)
http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/9fc2504965ce8197862567f600638e94?OpenDocument

is where the queueing stuff is, and my code is attached.
0 Kudos
Message 2 of 4
(3,414 Views)
Phredrick,

This can also be done using the new Event Structure in LabVIEW 6.1 using the Application Exiting event.

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
Message 3 of 4
(3,414 Views)
Excellent, however, I haven't got LabVIEW 6.1, so I'll try and puzzle it out with message queue.

-Dobbs
0 Kudos
Message 4 of 4
(3,414 Views)