S
stallone
Unregistered / Unconfirmed
GUEST, unregistred user!
我想把当前桌面设置为800x600,85HZ,可是没发现delphi6.0中有关于函数的介绍啊?
我查了查前人的贴子,发现有篇好象符合要求:
************************************************
用GetDeviceCaps函数
var
i:integer ;
begin
i:=GetDeviceCaps(GetDC(Handle),VREFRESH);
ShowMessage(inttostr(i));
end;
改变分辨率请使用下面的函数ChangeDisplaySettings
var
lpDevMode:TDEVMODE;
begin
lpDevMode.dmFields:=DM_DISPLAYFREQUENCY;
lpDevMode.dmDisplayFrequency:=85;
ChangeDisplaySettings(lpDevMode,0);
end;
function GetDisplayFrequency: Integer;//得到刷新率
var
DeviceMode: TDeviceMode;
begin
EnumDisplaySettings(nil, Cardinal(-1), DeviceMode);
Result := DeviceMode.dmDisplayFrequency;
end;
procedure ChangeDisplayFrequency(iFrequency:Integer);//更改刷新率,在Win2000下成功
var
DeviceMode: TDeviceMode;
begin
EnumDisplaySettings(nil,Cardinal(-1), DeviceMode);
DeviceMode.dmDisplayFrequency:=Cardinal(iFrequency);
ChangeDisplaySettings(DeviceMode,CDS_UPDATEREGISTRY);
end;
******************************************
可是我照贴后发现出错,主要是GetDeviceCaps函数
这里,我是初手,不大会用函数,哪位愿意帮助小弟实现夙愿?
我查了查前人的贴子,发现有篇好象符合要求:
************************************************
用GetDeviceCaps函数
var
i:integer ;
begin
i:=GetDeviceCaps(GetDC(Handle),VREFRESH);
ShowMessage(inttostr(i));
end;
改变分辨率请使用下面的函数ChangeDisplaySettings
var
lpDevMode:TDEVMODE;
begin
lpDevMode.dmFields:=DM_DISPLAYFREQUENCY;
lpDevMode.dmDisplayFrequency:=85;
ChangeDisplaySettings(lpDevMode,0);
end;
function GetDisplayFrequency: Integer;//得到刷新率
var
DeviceMode: TDeviceMode;
begin
EnumDisplaySettings(nil, Cardinal(-1), DeviceMode);
Result := DeviceMode.dmDisplayFrequency;
end;
procedure ChangeDisplayFrequency(iFrequency:Integer);//更改刷新率,在Win2000下成功
var
DeviceMode: TDeviceMode;
begin
EnumDisplaySettings(nil,Cardinal(-1), DeviceMode);
DeviceMode.dmDisplayFrequency:=Cardinal(iFrequency);
ChangeDisplaySettings(DeviceMode,CDS_UPDATEREGISTRY);
end;
******************************************
可是我照贴后发现出错,主要是GetDeviceCaps函数
这里,我是初手,不大会用函数,哪位愿意帮助小弟实现夙愿?