Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think you mean double-clicking on the title bar because double clicking on the system menu closes the form.<br> WM_SYSCOMMAND should work since the sequence of messages when double-clicking on the title bar to restore the form is:</p> <pre><code>Message posted: hwnd=$004E0820 WM_NCLBUTTONDBLCLK wParam $00000002 lParam $000705D4 Process Project1.exe (2380) =&gt; Message sent: hwnd=$004E0820 WM_SYSCOMMAND restore cmd requested (-44,-44) Process Project1.exe (2380) Message sent: hwnd=$004E0820 WM_WINDOWPOSCHANGING wParam $00000000 lParam $0012F4CC Process Project1.exe (2380) Message sent: hwnd=$004E0820 WM_GETMINMAXINFO wParam $00000000 lParam $0012EF6C Process Project1.exe (2380) Message sent: hwnd=$004E0820 WM_NCCALCSIZE wParam $00000001 lParam $0012F4A0 Process Project1.exe (2380) Message sent: hwnd=$004E0820 WM_NCPAINT update region 40040F4B Process Project1.exe (2380) Message sent: hwnd=$004E0820 WM_ERASEBKGND wParam $31011DCA lParam $00000000 Process Project1.exe (2380) Message sent: hwnd=$004E0820 WM_WINDOWPOSCHANGED wParam $00000000 lParam $0012F4CC Process Project1.exe (2380) </code></pre> <p>The problem is that the <strong>CmdType const SC_RESTORE2</strong> = 61730 //0xF122 is <strong>missing</strong> in Windows.pas. </p> <p>See the working code below:</p> <pre><code>type TForm7 = class(TForm) private procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND; end; var Form7: TForm7; implementation {$R *.dfm} { TForm7 } const SC_RESTORE2 = 61730; //0xF122 procedure TForm7.WMSysCommand(var Message: TWMSysCommand); begin case Message.CmdType of SC_RESTORE2 : beep; end; inherited; end; </code></pre> <p><strong>Update</strong>: reference to <code>SC_RESTORE2</code> from <a href="http://msdn.microsoft.com/en-us/library/ms646360%28VS.85%29.aspx" rel="noreferrer"><strong>WM_SYSCOMMAND</strong> Notification on MSDN</a> (see the "values in C#" part)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload