//截取屏幕宽高
GetSystemMetrics(SM_CXSCREEN)
GetSystemMetrics(SM_CYSCREEN)
方法一(通过 Width、ClientWidth 推算):
var
frame,caption: Integer;
begin
frame := (Width - ClientWidth) div 2;
caption := Height - ClientHeight - frame * 2;
ShowMessageFmt('边框宽: %d; 标题高: %d', [frame,caption]); {边框宽: 4; 标题高: 26}
end;
方法二(用 GetSystemMetrics 函数获取):
var
frame,caption: Integer;
begin
frame := GetSystemMetrics(SM_CXFRAME);
caption := GetSystemMetrics(SM_CYCAPTION);
ShowMessageFmt('边框宽: %d; 标题高: %d', [frame,caption]); {边框宽: 4; 标题高: 26}
end;