Archive: Handling WM_CLOSE in nsis


Handling WM_CLOSE in nsis
How can I handle WM_CLOSE message of a custom page ?

I want to add the app in system tray(using NotifyIcon plugin) when user closes the dialog.

Any ideas?


Why WM_CLOSE?

NSIS offers several ways how to handle installer's exit.

You can use .onUserAbort, .onInstFailed, .onInstSuccess or .onGUIEnd callbacks to handle various situations.

.onGUIEnd is fired everytime (after window closes)

.onInstSuccess is fired when the install was successful, right before the install window closes

.onInstFailed when the user hits the 'cancel' button after the install has failed

.onUserAbort when the user hits the 'cancel' button, and the install hasn't already failed.

As you see all cases are handled, see NSIS manual for details.


.onGUIEnd is not called in silent mode.


Originally posted by MSG
.onGUIEnd is not called in silent mode.
That is true but if his installer is running in silent mode there is no window to minimize to tray ;)