I need to handle when the user restores the form by double clicking the title bar. I tried handling the WM_SYSCOMMAND window message however this only works if the user restores the form via clicking the restore button in the system menu.
I am using DevExpress ribbon form components if this matters.
Thanks.
I think you mean double-clicking on the title bar because double clicking on the system menu closes the form.
WM_SYSCOMMAND should work since the sequence of messages when double-clicking on the title bar to restore the form is:
The problem is that the CmdType const SC_RESTORE2 = 61730 //0xF122 is missing in Windows.pas.
See the working code below:
Update: reference to
SC_RESTORE2from WM_SYSCOMMAND Notification on MSDN (see the “values in C#” part)