thank you everyone.
I followed your valuable suggestions and somehow made it work.. It just works, however since we are capturing maximize action manually and setting the form size to desktop width and height, i cannot enable or display restore button.
is there a way to show restore button after the form has been expanded to cover the screen?
Is there a way to preven the form not to get expanded beyond task bar area? Currently the form gets expanded and goes under taskbar causing some of the elements to be hidden..
Code:
procedure TForm1.WMSyscommand(var Msg: TWmSysCommand);
begin
case (Msg.cmdtype and $FFF0) of
SC_MINIMIZE:
begin
// ...
end;
SC_RESTORE:
begin
// ...
end;
SC_MAXIMIZE:
begin
ShowMessage('ha Maximize');
Form1.Width := screen.Width;
Form1.Height := screen.Height;
Form1.Left := 0;
Form1.Top := 0;
exit; // use exit if you want to cancel maximize
end;
end;
inherited;