var
Form1: TForm1;
modes: TDevMode ;
implementation
3. “Button1” tugmachasining dasturlash maydonchasiga quyidagi dasturni kiritamiz:
var i:integer;
begin
i:=0;
while (EnumDisplaySettings(nil,i,modes)) do
begin
ListBox1.Items.Add(IntToStr(modes.dmBitsPerPel)+
155
' '+IntToStr(modes.dmPelsWidth)+
' '+IntToStr(modes.dmPelsHeight)+
' '+IntToStr(modes.dmDisplayFrequency));
inc(i);
end;
end;
4. “Button2” tugmachasining dasturlash maydonchasiga quyidagi dasturni kiritamiz:
var n:integer;
begin
n:=ListBox1.ItemIndex;
EnumDisplaySettings(nil,n,modes);
ChangeDisplaySettings(modes,CDS_UPDATEREGISTRY );
end;
5. “F9” tugmasini tanlaymiz.
Dastur kodi va oynaning umumiy ko‘rinishini keltiramiz:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
ListBox1: TListBox;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
modes: TDevMode ;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
i:=0;
while (EnumDisplaySettings(nil,i,modes)) do
begin
ListBox1.Items.Add(IntToStr(modes.dmBitsPerPel)+
' '+IntToStr(modes.dmPelsWidth)+
Do'stlaringiz bilan baham: |