📄 getsystemmetricsu.pas
字号:
unit GetSystemMetricsU;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
ListBox1: TListBox;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
with ListBox1.Items do
begin
{display the minimized window arrangement}
Add('Minimized Window Arrangement -');
if (GetSystemMetrics(SM_ARRANGE) and ARW_BOTTOMLEFT)=ARW_BOTTOMLEFT then
Add(' Starts in the lower left corner');
if (GetSystemMetrics(SM_ARRANGE) and ARW_BOTTOMRIGHT)=ARW_BOTTOMRIGHT then
Add(' Starts in the lower right corner');
if (GetSystemMetrics(SM_ARRANGE) and ARW_HIDE)=ARW_HIDE then
Add(' Minimized windows are hidden');
if (GetSystemMetrics(SM_ARRANGE) and ARW_TOPLEFT)=ARW_TOPLEFT then
Add(' Starts in the top left corder');
if (GetSystemMetrics(SM_ARRANGE) and ARW_TOPRIGHT)=ARW_TOPRIGHT then
Add(' Starts in the top right corner');
if (GetSystemMetrics(SM_ARRANGE) and ARW_DOWN)=ARW_DOWN then
Add(' Arranged vertically, top to bottom');
if (GetSystemMetrics(SM_ARRANGE) and ARW_LEFT)=ARW_LEFT then
Add(' Arranged horizontally, left to right');
if (GetSystemMetrics(SM_ARRANGE) and ARW_RIGHT)=ARW_RIGHT then
Add(' Arranged horizontally, right to left');
if (GetSystemMetrics(SM_ARRANGE) and ARW_UP)=ARW_UP then
Add(' Arrange vertically, bottom to top');
{display window border dimensions}
Add('Window border width: '+IntToStr(GetSystemMetrics(SM_CXEDGE)));
Add('Window border height: '+IntToStr(GetSystemMetrics(SM_CYEDGE)));
{display cursor dimensions}
Add('Cursor width: '+IntToStr(GetSystemMetrics(SM_CXCURSOR)));
Add('Cursor height: '+IntToStr(GetSystemMetrics(SM_CYCURSOR)));
{display icon dimensions}
Add('Icon width: '+IntToStr(GetSystemMetrics(SM_CXICON)));
Add('Icon height: '+IntToStr(GetSystemMetrics(SM_CYICON)));
{display maximized window dimensions}
Add('Maximized window width: '+IntToStr(GetSystemMetrics(SM_CXMAXIMIZED)));
Add('Maximized window height: '+IntToStr(GetSystemMetrics(SM_CYMAXIMIZED)));
{display screen dimensions}
Add('Screen width: '+IntToStr(GetSystemMetrics(SM_CXSCREEN)));
Add('Screen height: '+IntToStr(GetSystemMetrics(SM_CYSCREEN)));
{display the caption height}
Add('Caption height: '+IntToStr(GetSystemMetrics(SM_CYCAPTION)));
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -