title: Correct way to maximize form in delphi (without caption)
body: <p>I have a form without caption, using on double click to maximize : Code looks like this:</p>
  
  <pre><code>procedure xxxxxx; 
  begin
      if Form1.WindowState=wsNormal then
         begin
          Form1.WindowState:=wsMaximized;
          Form1.SetBounds(0,0,screen.Width,screen.Height-getHeightOfTaskBar);
         end
         else
         begin
           Form1.WindowState:=wsNormal;
         end;
  
         ShowTrayWindow;
  end;
  function getHeightOfTaskBar : integer;
  var hTaskBar:HWND;
      rect : TRect;
  begin
       hTaskbar := FindWindow('Shell_TrayWnd', Nil );
       if hTaskBar&lt;&gt;0 then
          GetWindowRect(hTaskBar, rect);
  
       Result:=rect.bottom - rect.top;
  end;
  </code></pre>
  
  <p>This works good, except that I have to figure out where is task bar to reset SetBounds ...</p>
  
  <p>What is the correct way to do this?</p>
  
  <p>Thanks.</p>