Trapping For Alt-F4 On Exit

Startbeitrag von André Labuschagné am 15.03.2017 20:33

Hi All

I have managed to successfully trap for X button on the window being pressed and then instead making the app invisible and putting it into the system tray. The code for this is in a button that has the Alt-F4 key assigned to as the alert key. I have also managed to assign a popup menu to the icon. The one option is to restore the app. The other is to exit the app. If the app is restored and the user presses the X button again the button is ignored and the code in the button does not fire. It is as if the Alt-F4 key is no longer trapped by the button code. Why would this be? Are there any tricks?

Cheers
Andre

Antworten:

Found the problem. I was making the window invisible instead iconizing it. The result was that the alert assignment on the button was negated.

Andre

von André Labuschagné - am 15.03.2017 20:37
False fix - I do not want to minimize and that is all iconize does - so it appears in the task bar. Back to the drawing board.

von André Labuschagné - am 15.03.2017 20:44
Good fix now. Hand coded the restore and all sorted.

Hope this helps others.

Cheers
Andre

von André Labuschagné - am 15.03.2017 20:59
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.