Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title How can I ask for confirmation before my application is closed?
Ref. No. QNX.000000713
Category(ies) Development
Issue I want to be notified when the user presses Alt-F4 to close a window so I can implement code to ask the user if they want to cancel, or save their changes.


Solution You need to set the resources on the base window so that it does not handle the close message, but will notify you.

Pt_ARG_WINDOW_MANAGED_FLAGS should have the Ph_WM_CLOSE turned off, and the
Pt_ARG_WINDOW_NOTIFY_FLAGS should have it turned on.

Then Attach a Pt_CB_WINDOW Callback, and check the sub-types, and then handle the close message by doing your display window code.