Студопедия — Unit1.pas
Студопедия Главная Случайная страница Обратная связь

Разделы: Автомобили Астрономия Биология География Дом и сад Другие языки Другое Информатика История Культура Литература Логика Математика Медицина Металлургия Механика Образование Охрана труда Педагогика Политика Право Психология Религия Риторика Социология Спорт Строительство Технология Туризм Физика Философия Финансы Химия Черчение Экология Экономика Электроника

Unit1.pas

Текст програми

unit Unit1;

 

interface

 

uses

Windows, Registry, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, ExtCtrls, Unit2;

 

type

// Main form

TMainForm = class(TForm)

DoTestButton: TButton;

DoCloseButton: TButton;

TestsRadioGroup: TRadioGroup;

CheckBox1: TCheckBox;

CheckBox2: TCheckBox;

CheckBox3: TCheckBox;

CheckBox4: TCheckBox;

CheckBox5: TCheckBox;

CheckBox6: TCheckBox;

CheckBox7: TCheckBox;

CheckBox8: TCheckBox;

CheckBox9: TCheckBox;

InformGroupBox: TGroupBox;

OSWindows: TEdit;

OSFullName: TEdit;

OSKernelType: TEdit;

OSWindowsLabel: TLabel;

FullNameLabel: TLabel;

KernelTypeLabel: TLabel;

VideoInfoGroupBox: TGroupBox;

VideoInfoMemo: TMemo;

VideoAdapter: TEdit;

VideoAdapterLabel: TLabel;

SupVidModesLabel: TLabel;

procedure DoCloseButtonClick(Sender: TObject);

procedure DoTestButtonClick(Sender: TObject);

procedure FormShow(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

 

var

MainForm: TMainForm;

 

implementation

 

{$R *.dfm}

 

function ReverseVideoSharpness(hWind: HWND):Integer;

var

dc: HDC;

Screen: TScreen;

sizes: TRect;

i: Integer;

Brush1, Brush2: HBRUSH;

begin

 

dc:=GetDC(hWind);

 

Brush1:= BLACK_BRUSH;

Brush2:= WHITE_BRUSH;

 

sizes.Left:=0;

sizes.Top:=0;

sizes.Right:=Screen.Width;

sizes.Bottom:=Trunc(Screen.Height/2);

 

SelectObject(dc, GetStockObject(Brush1));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

 

sizes.Left:=0;

sizes.Top:=Trunc(Screen.Height/2);

sizes.Right:=Screen.Width;

sizes.Bottom:=Screen.Height;

SelectObject(dc, GetStockObject(Brush2));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

 

for i:=0 to 50 do

begin

sizes.Left:=1+100*i;

sizes.Top:=0;

sizes.Right:=100+100*i;

sizes.Bottom:=Trunc(Screen.Height/2);

 

SelectObject(dc, GetStockObject(Brush2));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

 

sizes.Left:=1+100*i;

sizes.Top:=Trunc(Screen.Height/2)+1;

sizes.Right:=100+100*i;

sizes.Bottom:=Screen.Height;

 

SelectObject(dc, GetStockObject(Brush1));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

 

end;

 

ReleaseDC(hWind,dc);

end;

 

function FlickerSeverity(hWind: HWND):Integer;

var

Screen: TScreen;

dc: HDC;

sizes: TRect;

begin

 

dc:=GetDC(hWind);

 

sizes.Left:=0;

sizes.Top:=0;

 

sizes.Right:=Screen.Width;

sizes.Bottom:=Screen.Height;

 

SelectObject(dc, GetStockObject(WHITE_BRUSH));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

 

ReleaseDC(hWind,dc);

 

end;

 

function GlareSeverity(hWind: HWND):Integer;

var

Screen: TScreen;

dc: HDC;

sizes: TRect;

begin

 

dc:=GetDC(hWind);

 

sizes.Left:=0;

sizes.Top:=0;

 

sizes.Right:=Screen.Width;

sizes.Bottom:=Screen.Height;

 

SelectObject(dc, GetStockObject(BLACK_BRUSH));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

 

ReleaseDC(hWind,dc);

 

end;

 

function InterlacingDetecting(hWind: HWND):Integer;

var

Screen: TScreen;

dc: HDC;

sizes: TRect;

x,y: Integer;

x1,x2,y1,y2: Integer;

oldPoint: PPOINT;

begin

dc:=GetDC(hWind);

 

sizes.Left:=0;

sizes.Top:=0;

 

sizes.Right:=Screen.Width;

sizes.Bottom:=Screen.Height;

y:=0;

while y <> sizes.Bottom do begin

x1:=Screen.Width;

y1:=y;

SelectObject(dc, GetStockObject(BLACK_BRUSH));

MoveToEx(dc,0,y1, oldPoint);

LineTo(dc,x1,y1);

 

x2:=Screen.Width;

y2:=y+2;

MoveToEx(dc,0,y2, oldPoint);

SelectObject(dc, GetStockObject(WHITE_BRUSH));

LineTo(dc,x2,y2);

y:=y+4;

end;

 

ReleaseDC(hWind,dc);

end;

 

function ScreenRegulation(Form:TForm):Integer;

var

Screen: TScreen;

hWind: hWnd;

dc: HDC;

sizes: TRect;

i: Integer;

Brush1, Brush2: HBRUSH;

 

begin

 

hWind:=Form.Handle;

dc:=GetDC(hWind);

 

i:=0;

 

while i<>3 do begin

 

if (i div 2)=0 then

begin

Brush1:= BLACK_BRUSH;

Brush2:= WHITE_BRUSH;

end

else

begin

Brush1:= WHITE_BRUSH;

Brush2:= BLACK_BRUSH;

end;

 

sizes.Left:=0;

sizes.Top:=0;

sizes.Right:=Screen.Width;

sizes.Bottom:=Trunc(Screen.Height/2);

 

SelectObject(dc, GetStockObject(Brush1));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

 

 

sizes.Left:=0;

sizes.Top:=Trunc(Screen.Height/2);

sizes.Right:=Screen.Width;

sizes.Bottom:=Screen.Height;

SelectObject(dc, GetStockObject(Brush2));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

 

inc (i);

 

end;

 

ReleaseDC(hWind,dc);

end;

 

function PrimaryColorPurity(hWind: HWND):Integer;

var

Screen: TScreen;

dc: HDC;

sizes: TRect;

delta: Integer;

begin

dc:=GetDC(hWind);

 

sizes.Left:=0;

sizes.Top:=0;

 

sizes.Right:=Screen.Width;

sizes.Bottom:=Screen.Height;

 

SelectObject(dc, GetStockObject(DC_BRUSH));

SetDCBrushColor(dc, RGB(0,0,0));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

 

// Draw RED

sizes.Left:=25;

sizes.Top:=80;

 

delta:=Trunc(Screen.Width/3);

sizes.Right:=delta-25;

sizes.Bottom:=Screen.Height-80;

 

SelectObject(dc, GetStockObject(DC_BRUSH));

SetDCBrushColor(dc, RGB(255,0,0));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

 

// Draw GREEN

sizes.Left:=delta*2-25;

sizes.Top:=80;

 

sizes.Right:=delta;

sizes.Bottom:=Screen.Height-80;

 

SelectObject(dc, GetStockObject(DC_BRUSH));

SetDCBrushColor(dc, RGB(0,255,0));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

// Draw BLUE

sizes.Left:=delta*3-25;

sizes.Top:=80;

 

sizes.Right:=delta*2;

sizes.Bottom:=Screen.Height-80;

 

SelectObject(dc, GetStockObject(DC_BRUSH));

SetDCBrushColor(dc, RGB(0,0,255));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

 

ReleaseDC(hWind,dc);

end;

 

function ColorIntensityGradient(hWind: HWND):Integer;

var

Screen: TScreen;

dc: HDC;

sizes: TRect;

delta: Integer;

i, j, minX, maxX, minY, maxY: Integer;

countColor, CurrentColor: Integer;

oldPoint: PPOINT;

begin

 

dc:=GetDC(hWind);

sizes.Left:=0;

sizes.Top:=0;

 

sizes.Right:=Screen.Width;

sizes.Bottom:=Screen.Height;

// Fill screen with black color

SelectObject(dc, GetStockObject(DC_BRUSH));

SetDCBrushColor(dc, RGB(0,0,0));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

//----------------------------------------------------------------

 

delta:=Trunc(Screen.Height/8);

countColor:=Trunc(Screen.Width/254);

minY:=0;

maxY:=delta;

 

minX:=0;

maxX:=Screen.Width;

 

// Draw BLACK gradient

sizes.Left:=0;

sizes.Top:=0;

 

sizes.Right:=0;

sizes.Bottom:=delta;

j:=0;

CurrentColor:=0;

 

for i:=0 to maxX-1 do

begin

if j=countColor then

begin

inc(CurrentColor);

j:=0;

end;

MoveToEx(dc,i, sizes.Top, nil);

SelectObject(dc, GetStockObject(DC_PEN));

SetDCPenColor(dc, RGB(0,0,0));

LineTo(dc, i, sizes.Bottom);

inc(j);

end;

// Draw RED gradient

sizes.Left:=0;

sizes.Top:=delta;

 

sizes.Right:=0;

sizes.Bottom:=delta*2;

j:=0;

CurrentColor:=0;

 

for i:=0 to maxX-1 do

begin

if j=countColor then

begin

inc(CurrentColor);

j:=0;

end;

MoveToEx(dc,i, sizes.Top, nil);

SelectObject(dc, GetStockObject(DC_PEN));

SetDCPenColor(dc, RGB(CurrentColor,0,0));

LineTo(dc, i, sizes.Bottom);

inc(j);

end;

 

// Draw GREEN gradient

sizes.Left:=0;

sizes.Top:=delta*2;

 

sizes.Right:=0;

sizes.Bottom:=delta*3;

j:=0;

CurrentColor:=0;

 

for i:=0 to maxX-1 do

begin

if j=countColor then

begin

inc(CurrentColor);

j:=0;

end;

MoveToEx(dc,i, sizes.Top, nil);

SelectObject(dc, GetStockObject(DC_PEN));

SetDCPenColor(dc, RGB(0,CurrentColor,0));

LineTo(dc, i, sizes.Bottom);

inc(j);

end;

 

// Draw YELLOW gradient

sizes.Left:=0;

sizes.Top:=delta*3;

 

sizes.Right:=0;

sizes.Bottom:=delta*4;

j:=0;

CurrentColor:=0;

 

for i:=0 to maxX-1 do

begin

if j=countColor then

begin

inc(CurrentColor);

j:=0;

end;

MoveToEx(dc,i, sizes.Top, nil);

SelectObject(dc, GetStockObject(DC_PEN));

SetDCPenColor(dc, RGB(CurrentColor,CurrentColor,0));

LineTo(dc, i, sizes.Bottom);

inc(j);

end;

 

// Draw BLUE gradient

sizes.Left:=0;

sizes.Top:=delta*4;

 

sizes.Right:=0;

sizes.Bottom:=delta*5;

j:=0;

CurrentColor:=0;

 

for i:=0 to maxX-1 do

begin

if j=countColor then

begin

inc(CurrentColor);

j:=0;

end;

MoveToEx(dc,i, sizes.Top, nil);

SelectObject(dc, GetStockObject(DC_PEN));

SetDCPenColor(dc, RGB(0,0,CurrentColor));

LineTo(dc, i, sizes.Bottom);

inc(j);

end;

 

// Draw CYAN gradient

sizes.Left:=0;

sizes.Top:=delta*5;

 

sizes.Right:=0;

sizes.Bottom:=delta*6;

j:=0;

CurrentColor:=0;

 

for i:=0 to maxX-1 do

begin

if j=countColor then

begin

inc(CurrentColor);

j:=0;

end;

MoveToEx(dc,i, sizes.Top, nil);

SelectObject(dc, GetStockObject(DC_PEN));

SetDCPenColor(dc, RGB(CurrentColor,0,CurrentColor));

LineTo(dc, i, sizes.Bottom);

inc(j);

end;

 

// Draw PURPLE gradient

sizes.Left:=0;

sizes.Top:=delta*5;

 

sizes.Right:=0;

sizes.Bottom:=delta*6;

j:=0;

CurrentColor:=0;

 

for i:=0 to maxX-1 do

begin

if j=countColor then

begin

inc(CurrentColor);

j:=0;

end;

MoveToEx(dc,i, sizes.Top, nil);

SelectObject(dc, GetStockObject(DC_PEN));

SetDCPenColor(dc, RGB(CurrentColor,0,CurrentColor));

LineTo(dc, i, sizes.Bottom);

inc(j);

end;

 

// Draw LIGHT BLUE gradient

sizes.Left:=0;

sizes.Top:=delta*6;

 

sizes.Right:=0;

sizes.Bottom:=delta*7;

j:=0;

CurrentColor:=0;

 

for i:=0 to maxX-1 do

begin

if j=countColor then

begin

inc(CurrentColor);

j:=0;

end;

MoveToEx(dc,i, sizes.Top, nil);

SelectObject(dc, GetStockObject(DC_PEN));

SetDCPenColor(dc, RGB(0,CurrentColor,CurrentColor));

LineTo(dc, i, sizes.Bottom);

inc(j);

end;

 

// Draw GREY gradient

sizes.Left:=0;

sizes.Top:=delta*7;

 

sizes.Right:=0;

sizes.Bottom:=delta*8;

j:=0;

CurrentColor:=0;

 

for i:=0 to maxX-1 do

begin

if j=countColor then

begin

inc(CurrentColor);

j:=0;

end;

MoveToEx(dc,i, sizes.Top, nil);

SelectObject(dc, GetStockObject(DC_PEN));

SetDCPenColor(dc, RGB(CurrentColor,CurrentColor,CurrentColor));

LineTo(dc, i, sizes.Bottom);

inc(j);

end;

ReleaseDC(hWind,dc);

end;

 

function ColorAlignmentGrid(hWind: HWND):Integer;

var

Screen: TScreen;

dc: HDC;

sizes: TRect;

deltaX, deltaY: Integer;

i: Integer;

begin

dc:=GetDC(hWind);

 

sizes.Left:=0;

sizes.Top:=0;

 

sizes.Right:=Screen.Width;

sizes.Bottom:=Screen.Height;

 

// Fill screen with black color

SelectObject(dc, GetStockObject(DC_BRUSH));

SetDCBrushColor(dc, RGB(0,0,0));

 

SelectObject(dc, GetStockObject(DC_PEN));

SetDCPenColor(dc, RGB(0,255,0));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

 

deltaX:=Trunc(Screen.Width/8);

deltaY:=Trunc(Screen.Height/8);

 

for i:=0 to 8 do

begin

// Horizontal Lines

MoveToEx(dc,0, deltaY*i,nil);

LineTo(dc, Screen.Width, deltaY*i);

// Vertical Lines

MoveToEx(dc, deltaX*i, 0,nil);

LineTo(dc, deltaX*i, Screen.Height);

end;

 

 

ReleaseDC(hWind,dc);

end;

 

function ColorSynchronization(hWind: HWND):Integer;

var

Screen: TScreen;

dc: HDC;

sizes: TRect;

delta: Integer;

 

begin

dc:=GetDC(hWind);

 

sizes.Left:=0;

sizes.Top:=0;

 

sizes.Right:=Screen.Width;

sizes.Bottom:=Screen.Height;

 

SelectObject(dc, GetStockObject(DC_BRUSH));

SetDCBrushColor(dc, RGB(0,0,0));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

 

// Draw CYAN

sizes.Left:=80;

sizes.Top:=80;

 

delta:=Trunc(Screen.Width/3);

sizes.Right:=delta;

sizes.Bottom:=Screen.Height-80;

 

SelectObject(dc, GetStockObject(DC_BRUSH));

SetDCBrushColor(dc, RGB(0,255,255));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

 

// Draw RED

sizes.Left:=delta*2;

sizes.Top:=80;

 

sizes.Right:=delta;

sizes.Bottom:=Screen.Height-80;

 

SelectObject(dc, GetStockObject(DC_BRUSH));

SetDCBrushColor(dc, RGB(255,0,0));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

// Draw CYAN

sizes.Left:=delta*3-80;

sizes.Top:=80;

 

sizes.Right:=delta*2;

sizes.Bottom:=Screen.Height-80;

 

SelectObject(dc, GetStockObject(DC_BRUSH));

SetDCBrushColor(dc, RGB(0,255,255));

Rectangle(dc, sizes.Left, sizes.Top, sizes.Right, sizes.Bottom);

 

ReleaseDC(hWind,dc);

end;

 

function GetWindowsOSInfo():String;

var

OSVerInfo: OSVERSIONINFO;

begin

OSVerInfo.dwOSVersionInfoSize:=sizeof(OSVERSIONINFO);

 

GetVersionEx(OSVerInfo);

 

if (OSVerInfo.dwMajorVersion=5) and (OSVerInfo.dwMinorVersion=2) then GetWindowsOSInfo:='Microsoft Windows Server 2003 5.2.' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' (Win32 x86)' + ' (' + OSVerInfo.szCSDVersion+')'

else

if (OSVerInfo.dwMajorVersion=5) and (OSVerInfo.dwMinorVersion=1) then GetWindowsOSInfo:='Microsoft Windows XP 5.1.' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' (Win32 x86)' +' (' + OSVerInfo.szCSDVersion + ')'

else

if (OSVerInfo.dwMajorVersion=5) and (OSVerInfo.dwMinorVersion=0) then GetWindowsOSInfo:='Microsoft Windows 2000 5.0.' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' (Win32 x86)' + ' (' + OSVerInfo.szCSDVersion + ')'

else

if (OSVerInfo.dwMajorVersion=4) and (OSVerInfo.dwMinorVersion=0) and (OSVerInfo.dwPlatformID=VER_PLATFORM_WIN32_NT) then GetWindowsOSInfo:='Microsoft Windows NT 4.0.' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' (Win32 x86)' + ' (' + OSVerInfo.szCSDVersion + ')'

else

if (OSVerInfo.dwMajorVersion=4) and (OSVerInfo.dwMinorVersion=90) then GetWindowsOSInfo:='Microsoft Windows ME Build:' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' (Win32 x86)' + ' (' + OSVerInfo.szCSDVersion + ')'

else

if (OSVerInfo.dwMajorVersion=4) and (OSVerInfo.dwMinorVersion=10)and (OSVerInfo.dwPlatformID=VER_PLATFORM_WIN32_WINDOWS) then GetWindowsOSInfo:='Microsoft Windows 98 Build:' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' (Win32 x86)' + ' (' + OSVerInfo.szCSDVersion + ')'

else

if (OSVerInfo.dwMajorVersion=4) and (OSVerInfo.dwMinorVersion=0)and (OSVerInfo.dwPlatformID=VER_PLATFORM_WIN32_WINDOWS) then GetWindowsOSInfo:='Microsoft Windows 95 Build:' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' (Win32 x86)' + ' (' + OSVerInfo.szCSDVersion + ')'

else

if (OSVerInfo.dwMajorVersion=3) and (OSVerInfo.dwMinorVersion=51)and (OSVerInfo.dwPlatformID=VER_PLATFORM_WIN32s) then GetWindowsOSInfo:='Microsoft Windows NT 3.51.' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' (Win32 x86)' + ' (' + OSVerInfo.szCSDVersion + ')'

else GetWindowsOSInfo:='OS version undefined';

 

 

end;

 

function GetFullOSInfo():String;

var

OSVerInfo: OSVERSIONINFO;

begin

 

OSVerInfo.dwOSVersionInfoSize:=sizeof(OSVERSIONINFO);

 

GetVersionEx(OSVerInfo);

 

if (OSVerInfo.dwMajorVersion=5) and (OSVerInfo.dwMinorVersion=2) then GetFullOSInfo:='Microsoft Windows Server 2003 5.2.' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' ' + OSVerInfo.szCSDVersion

else

if (OSVerInfo.dwMajorVersion=5) and (OSVerInfo.dwMinorVersion=1) then GetFullOSInfo:='Microsoft Windows XP 5.1.' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' ' + OSVerInfo.szCSDVersion

else

if (OSVerInfo.dwMajorVersion=5) and (OSVerInfo.dwMinorVersion=0) then GetFullOSInfo:='Microsoft Windows 2000 5.0.' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' ' + OSVerInfo.szCSDVersion

else

if (OSVerInfo.dwMajorVersion=4) and (OSVerInfo.dwMinorVersion=0) and (OSVerInfo.dwPlatformID=VER_PLATFORM_WIN32_NT) then GetFullOSInfo:='Microsoft Windows NT 4.0.' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' ' + OSVerInfo.szCSDVersion

else

if (OSVerInfo.dwMajorVersion=4) and (OSVerInfo.dwMinorVersion=90) then GetFullOSInfo:='Microsoft Windows ME Build:' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' ' + OSVerInfo.szCSDVersion

else

if (OSVerInfo.dwMajorVersion=4) and (OSVerInfo.dwMinorVersion=10)and (OSVerInfo.dwPlatformID=VER_PLATFORM_WIN32_WINDOWS) then GetFullOSInfo:='Microsoft Windows 98 Build:' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' ' + OSVerInfo.szCSDVersion

else

if (OSVerInfo.dwMajorVersion=4) and (OSVerInfo.dwMinorVersion=0)and (OSVerInfo.dwPlatformID=VER_PLATFORM_WIN32_WINDOWS) then GetFullOSInfo:='Microsoft Windows 95 Build:' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' ' + OSVerInfo.szCSDVersion

else

if (OSVerInfo.dwMajorVersion=3) and (OSVerInfo.dwMinorVersion=51)and (OSVerInfo.dwPlatformID=VER_PLATFORM_WIN32s) then GetFullOSInfo:='Microsoft Windows NT 3.51.' + (IntToStr(OSVerInfo.dwBuildNumber)) + ' ' + OSVerInfo.szCSDVersion

else GetFullOSInfo:='OS version undefined';

end;

 

function GetKernelOSInfo():String;

var

OSVerInfo: OSVERSIONINFO;

KernelType: String;

Registry: TRegistry;

begin

OSVerInfo.dwOSVersionInfoSize:=sizeof(OSVERSIONINFO);

GetVersionEx(OSVerInfo);

if OSVerInfo.dwPlatformID=VER_PLATFORM_WIN32_NT then

begin

Registry:= TRegistry.Create(KEY_READ);

Registry.RootKey:= HKEY_LOCAL_MACHINE;

Registry.OpenKeyReadOnly('\SOFTWARE\Microsoft\Windows NT\CurrentVersion\');

KernelType:= Registry.ReadString('CurrentType');

Registry.Free;

GetKernelOSInfo:=KernelType;

end

else GetKernelOSInfo:='SMP unsupported';

 

end;

 

function GetVideoResolutions(ModeNumber: DWORD; var res: BOOL):String;

var

DeviceName: PChar;

DeviceMode: TDeviceMode;

i: integer;

XRes,YRes, Freq, Col: Integer;

begin

DeviceMode.dmSize:=sizeof(DeviceMode);

res:=EnumDisplaySettings (nil, ModeNumber, DeviceMode);

XRes:=DeviceMode.dmPelsWidth;

YRes:=DeviceMode.dmPelsHeight;

Freq:=DeviceMode.dmDisplayFrequency;

Col:=DeviceMode.dmBitsPerPel;

GetVideoResolutions:=IntToStr(XRes) + 'x' + IntToStr(YRes) +'x' + IntToStr(Col)+ 'bpp ' + IntToStr(Freq) + 'Hz';

end;

function GetVideoAdapterName():String;

var

DisplayDevice: TDisplayDevice;

 

begin

DisplayDevice.cb:=sizeof(DisplayDevice);

EnumDisplayDevices (nil, 0, DisplayDevice, 0);

GetVideoAdapterName:=DisplayDevice.DeviceString;

end;

 

//*---------------------------------------------------------*//

procedure TMainForm.DoCloseButtonClick(Sender: TObject);

begin

Close();

end;

 

procedure TMainForm.DoTestButtonClick(Sender: TObject);

Var

Screen: TScreen;

hWindow: HWND;

Window_HDC: HDC;

 

begin

 

DrawForm.Width:=Screen.Width;

DrawForm.Height:=Screen.Height;

DrawForm.Show;

hWindow:=DrawForm.Handle;

 

if CheckBox1.Checked=true then ReverseVideoSharpness(hWindow);

 

if CheckBox2.Checked=true then FlickerSeverity(hWindow);

if CheckBox3.Checked=true then GlareSeverity(hWindow);

if CheckBox4.Checked=true then InterlacingDetecting(hWindow);

if CheckBox5.Checked=true then ScreenRegulation(DrawForm);

if CheckBox6.Checked=true then PrimaryColorPurity(hWindow);

if CheckBox7.Checked=true then ColorIntensityGradient(hWindow);

if CheckBox8.Checked=true then ColorAlignmentGrid(hWindow);

if CheckBox9.Checked=true then ColorSynchronization(hWindow);

 

end;

 

procedure TMainForm.FormShow(Sender: TObject);

var

i: Cardinal;

res: BOOL;

begin

OSFullName.Text:=GetFullOSInfo;

OSWindows.Text:=GetWindowsOSInfo;

OSKernelType.Text:=GetKernelOSInfo;

// Get Video Modes

i:=0;

res:=TRUE;

while (res<>FALSE) do

begin

VideoInfoMemo.Lines.Add(GetVideoResolutions(i,res));

inc(i);

end;

// Get Display Adapter Parameters

VideoAdapter.Text:=GetVideoAdapterName;

end;

end.




<== предыдущая лекция | следующая лекция ==>
Биологически активные добавки. Пробиотики. | How to Taste?

Дата добавления: 2015-09-07; просмотров: 325. Нарушение авторских прав; Мы поможем в написании вашей работы!



Вычисление основной дактилоскопической формулы Вычислением основной дактоформулы обычно занимается следователь. Для этого все десять пальцев разбиваются на пять пар...

Расчетные и графические задания Равновесный объем - это объем, определяемый равенством спроса и предложения...

Кардиналистский и ординалистский подходы Кардиналистский (количественный подход) к анализу полезности основан на представлении о возможности измерения различных благ в условных единицах полезности...

Обзор компонентов Multisim Компоненты – это основа любой схемы, это все элементы, из которых она состоит. Multisim оперирует с двумя категориями...

Сравнительно-исторический метод в языкознании сравнительно-исторический метод в языкознании является одним из основных и представляет собой совокупность приёмов...

Концептуальные модели труда учителя В отечественной литературе существует несколько подходов к пониманию профессиональной деятельности учителя, которые, дополняя друг друга, расширяют психологическое представление об эффективности профессионального труда учителя...

Конституционно-правовые нормы, их особенности и виды Характеристика отрасли права немыслима без уяснения особенностей составляющих ее норм...

ОПРЕДЕЛЕНИЕ ЦЕНТРА ТЯЖЕСТИ ПЛОСКОЙ ФИГУРЫ Сила, с которой тело притягивается к Земле, называется силой тяжести...

СПИД: морально-этические проблемы Среди тысяч заболеваний совершенно особое, даже исключительное, место занимает ВИЧ-инфекция...

Понятие массовых мероприятий, их виды Под массовыми мероприятиями следует понимать совокупность действий или явлений социальной жизни с участием большого количества граждан...

Studopedia.info - Студопедия - 2014-2024 год . (0.009 сек.) русская версия | украинская версия