Catching a close event and forcing a close event

I am developing an application using the Momentics IDE along with PhAB.

When my app launches, it dislpays the main window with a second window on top (the logon window).

What I need to do is two things:

  1. When the user successfully logs on, how do I force the logon window to close?

  2. Regardless of how the logon window closes, how do I catch the close event?

If the user successfully logs on, then I need to be able to force the logon window to close, catch the close event and enable the main window. (Currently the logon window calls PtBlockAllWindows, I need to call PtUnblockWindows if the logon is successful)

If the user does not successfully logon, then regardless of how they close the window ([X] button, Menu->Close, or a [Quit] button that I added to the interface) I need to catch the close event to make sure the entire application is closed.

I am currently using the Window Manager (Pt_CB_WINDOW) callback and it catches the close event when the [X] button or the Menu->Close options are used. However, it does not catch the [Quit] button that I added which uses the Activate (Pt_CB_ACTIVATE) callback and the Code Type of “Done”.

I appreciate any help


I’m fairly sure that there’s a library routine that will close the window for you.

I’m surprised that the window close callback doesn’t catch the ‘Done’ callback, but you could alway switch it to a code callback and in that callback cleanup and exit.