我以前写过的代码,你改一下吧。
function TSendMsg.GetStatus: string;
var
wp: TWindowPlacement;
begin
FillChar(wp, SizeOf(wp), 0);
wp.length := SizeOf(wp);
FindParentHandle;
if GetWindowPlacement(FHandle, @wp) then
begin
case wp.showCmd of
1:
result := '常态';
2:
result := '最小化';
3:
result := '最大化';
end;
end
else
result := '不存在';
end;