I have a form without caption, using on double click to maximize : Code looks like this:
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<>0 then
GetWindowRect(hTaskBar, rect);
Result:=rect.bottom - rect.top;
end;
This works good, except that I have to figure out where is task bar to reset SetBounds ...
What is the correct way to do this?
Thanks.