Старожил
Сообщения: 440
Благодарности: 251
|
Профиль
|
Сайт
|
Отправить PM
| Цитировать
semiono,
DisplayRes
Код:
[Setup]
AppName=DisplayResoltution
AppVerName=DisplayResoltution
DefaultDirName=DisplayResoltution
DisableStartupPrompt=true
Uninstallable=false
InternalCompressLevel=none
Compression=none
[_Code]
//functions to get BPP & resolution
//
// prototype for ISX 3.X
//
function DeleteDC(hDC: Integer): Integer; external 'DeleteDC@GDI32 stdcall';
function CreateDC(lpDriverName, lpDeviceName, lpOutput: String; lpInitData: Integer): Integer; external 'CreateDCA@GDI32 stdcall';
function GetDeviceCaps(hDC, nIndex: Integer): Integer; external 'GetDeviceCaps@GDI32 stdcall';
Const
HORZRES = 8; //horizontal resolution
VERTRES = 10; //vertical resolution
BITSPIXEL = 12; //bits per pixel
PLANES = 14; //number of planes (color depth=bits_per_pixel*number_of_planes)
function InitializeSetup(): Boolean;
var xres, yres, bpp, pl, tmp: Integer;
hDC: Integer;
begin
//get resolution & BPP
hDC := CreateDC('DISPLAY', '', '', 0);
pl := GetDeviceCaps(hDC, PLANES);
bpp := GetDeviceCaps(hDC, BITSPIXEL);
xres := GetDeviceCaps(hDC, HORZRES); //horizontal resolution
yres := GetDeviceCaps(hDC, VERTRES); //vertical resolution
// tmp := DeleteDC(hDC);
bpp := pl * bpp; //color depth
MsgBox( 'Current resolution is ' + IntToStr(xres) +
'x' + IntToStr(yres) +
' and color depth is ' + IntToStr( bpp )
, mbInformation, MB_OK );
Result := false;
end;
|
Отправлено: 12:28, 05-08-2010
| #2166
|