SmartSystemMenu icon indicating copy to clipboard operation
SmartSystemMenu copied to clipboard

Feature Request: Save window settings also when closing via [X] or Alt+F4

Open vicomannen opened this issue 4 months ago • 4 comments

Hello,

Thank you for developing SmartSystemMenu, it’s an excellent tool!

I noticed that window settings (transparency, alignment, priority, etc.) are saved correctly when I close a program using its own File → Exit menu option. However, if I close the same program with the standard [X] button in the title bar or Alt+F4 (including via SmartSystemMenu’s own “Close” menu), the window settings are not saved.

Would it be possible to make SmartSystemMenu save window settings also when windows are closed via [X] or Alt+F4? This would make the behavior consistent and prevent users from losing their configured settings.

Thank you for considering this improvement.

Best regards, Viktor

vicomannen avatar Aug 31 '25 22:08 vicomannen

Hello @vicomannen ,

Could you clarify whether the issue occurs on all windows or on some specific ones? For example, does Notepad have this problem? And are you sure you have selected "Save" menu item?

AlexanderPro avatar Sep 01 '25 11:09 AlexanderPro

Hello,

I have tested this mainly with Notepad3 and Notepad++. In both cases the issue occurs – window settings (transparency, alignment, position, etc.) are only saved if I exit via the application menu (File → Exit).

When closing the same windows with the [X] button, Alt+F4, or through SmartSystemMenu’s own “Close (Alt+F4)” menu, the settings are not saved. And yes, I have the "Save" menu item selected.

As an experiment, we

SSM - ApplicationMOD.zip

modified the source code in MainForm.cs to also trigger saving inside the SC_CLOSE case. With this small change, window settings are now saved correctly even when closing a window with [X] or Alt+F4.

Here is the relevant code snippet added in MainForm.cs:

case MenuItemId.SC_CLOSE: // Save window state when closing via [X] or Alt+F4 window.RefreshState(); _settingsService.SaveWindowState(window); break;

I am attaching SSM_ApplicationMOD.zip, which contains the modified build of SmartSystemMenu with this change implemented, in case you would like to review or test it.

vicomannen avatar Sep 01 '25 14:09 vicomannen

Thank you for the detailed explanation. I will try to check this case soon.

AlexanderPro avatar Sep 01 '25 15:09 AlexanderPro

Unfortunately I couldn't reproduce the issue for the Notepad++, but I made some small changes. Please, try version 2.32.0

AlexanderPro avatar Sep 07 '25 13:09 AlexanderPro