var
TmpAppBarDate: TAppBarData;
begin
TmpAppBarDate.cbSize := sizeof(TmpAppBarDate);
if SHAppBarMessage(ABM_GETSTATE, TmpAppBarDate) = 2 then
begin
SHAppBarMessage(ABM_GETTASKBARPOS, TmpAppBarDate);
if (Form1.Height + Form1.Top) > (Screen.Height - (TmpAppBarDate.rc.Bottom - TmpAppBarDate.rc.Top)) then
Form1.Height := (Screen.Height - (TmpAppBarDate.rc.Bottom - TmpAppBarDate.rc.Top)) - Form1.Top;
end;
end;
hgf用的是窗体设成无边框,这样最大化,最小化应该是另外的按钮做的,如果是这样,其实
不要像上面这么费,只要记下原始的值,再赋回去应该就可以了!