?? enumdisplaysettingsu.pas
字號(hào):
unit EnumDisplaySettingsU;
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);
var
DeviceInfo: TDevMode; // holds device information
DeviceCount: Integer; // tracks the number of display modes
begin
{initialize the tracking variable}
DeviceCount := 0;
{enumerate all display modes for the current display device}
while EnumDisplaySettings(NIL, DeviceCount, DeviceInfo) do
begin
{display the relevent information for the display mode}
ListBox1.Items.Add('Device '+IntToStr(DeviceCount)+' -');
ListBox1.Items.Add('Pixels/Inch: '+IntToSTr(DeviceInfo.dmLogPixels));
ListBox1.Items.Add('Bits/Pixel: '+IntToStr(DeviceInfo.dmBitsPerPel));
ListBox1.Items.Add('Pixel Width: '+IntToStr(DeviceInfo.dmPelsWidth));
ListBox1.Items.Add('Pixel Height: '+IntToStr(DeviceInfo.dmPelsHeight));
{indicate the display mode type}
case DeviceInfo.dmDisplayFlags of
DM_GRAYSCALE: ListBox1.Items.Add('Display Mode: Grayscale');
DM_INTERLACED: ListBox1.Items.Add('Display Mode: Interlaced');
end;
{indicate the refresh rate}
if (DeviceInfo.dmDisplayFrequency=0)or(DeviceInfo.dmDisplayFrequency=1) then
ListBox1.Items.Add('Refresh Rate: Hardware Default')
else
ListBox1.Items.Add('Refresh Rate: '+IntToStr(DeviceInfo.dmDisplayFrequency)+' hrz');
{add a blank line and increment the tracking variable}
ListBox1.Items.Add('');
Inc(DeviceCount);
end;
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -