怎样得到屏幕的刷新频率?(100分)

  • 主题发起人 主题发起人 lfqbl
  • 开始时间 开始时间
L

lfqbl

Unregistered / Unconfirmed
GUEST, unregistred user!
我用EnumDisplaySettings(nil, 0, lpDevMode),得到的刷新频率lpDevMode.dmDisplayFrequency怎么老是为零,还有我怎样改变刷新频率呢?
我用ChangeDisplaySettings(lpDevMode, CDS_UPDATEREGISTRY)将分辨率改为(1024,768)后,WIN 2000,WIN XP系统中的刷新频率为60HZ,
怎样才能把刷新频率改为原来的值呢?

 
function EnumDisplaySettings(lpszDeviceName: LPCWSTR; iModeNum: DWORD;
var lpDevMode: DEVMODEW): BOOL; stdcall; forward;
function EnumDisplaySettings; external 'user32.dll' name 'EnumDisplaySettingsW';


procedure TForm1.Button1Click(Sender: TObject);
var
lpszDeviceName: LPCWSTR;
iModeNum: DWORD;
lpDevMode: DEVMODEW;
begin
EnumDisplaySettings(nil,$FFFFFFFF,lpDevMode); //注意这里
Memo1.Lines.Add('BitsPerPel: '+inttostr(lpDevMode.dmBitsPerPel));
Memo1.Lines.Add('DeviceName: '+lpDevMode.dmDeviceName);
Memo1.Lines.Add('SpecVersion: '+inttostr(lpDevMode.dmSpecVersion));
Memo1.Lines.Add('DriverVersion: '+inttostr(lpDevMode.dmDriverVersion));
Memo1.Lines.Add('Size: '+inttostr(lpDevMode.dmSize));
Memo1.Lines.Add('DriverExtra: '+inttostr(lpDevMode.dmDriverExtra));
Memo1.Lines.Add('Fields: '+inttostr(lpDevMode.dmFields));
Memo1.Lines.Add('Orientation: '+inttostr(lpDevMode.dmOrientation));
Memo1.Lines.Add('PaperSize: '+inttostr(lpDevMode.dmPaperSize));
Memo1.Lines.Add('dmPaperLength: '+inttostr(lpDevMode.dmPaperLength));
Memo1.Lines.Add('PaperWidth: '+inttostr(lpDevMode.dmPaperWidth));
Memo1.Lines.Add('Scale: '+inttostr(lpDevMode.dmScale));
Memo1.Lines.Add('Copies: '+inttostr(lpDevMode.dmCopies));
Memo1.Lines.Add('DefaultSource: '+inttostr(lpDevMode.dmDefaultSource));
Memo1.Lines.Add('PrintQuality: '+inttostr(lpDevMode.dmPrintQuality));
Memo1.Lines.Add('Color: '+inttostr(lpDevMode.dmColor));
Memo1.Lines.Add('Duplex: '+inttostr(lpDevMode.dmDuplex));
Memo1.Lines.Add('YResolution: '+inttostr(lpDevMode.dmYResolution));
Memo1.Lines.Add('TTOption: '+inttostr(lpDevMode.dmTTOption));
Memo1.Lines.Add('Collate: '+inttostr(lpDevMode.dmCollate));

Memo1.Lines.Add('FormName: '+lpDevMode.dmFormName);
//Memo1.Lines.Add('PaperSize: '+inttostr(lpDevMode.dmUnusedPadding));
//Memo1.Lines.Add('PaperSize: '+inttostr(lpDevMode.dmBitsPerPixel));
Memo1.Lines.Add('PelsWidth: '+inttostr(lpDevMode.dmPelsWidth));
Memo1.Lines.Add('PelsHeight: '+inttostr(lpDevMode.dmPelsHeight));
Memo1.Lines.Add('DisplayFlags: '+inttostr(lpDevMode.dmDisplayFlags));
Memo1.Lines.Add('DisplayFrequency: '+inttostr(lpDevMode.dmDisplayFrequency));
Memo1.Lines.Add('ICMMethod: '+inttostr(lpDevMode.dmICMMethod));
Memo1.Lines.Add('ICMIntent: '+inttostr(lpDevMode.dmICMIntent));
Memo1.Lines.Add('MediaType: '+inttostr(lpDevMode.dmMediaType));
Memo1.Lines.Add('DitherType: '+inttostr(lpDevMode.dmDitherType));
//Memo1.Lines.Add('PaperSize: '+inttostr(lpDevMode.dmReserved1));
//Memo1.Lines.Add('PaperSize: '+inttostr(lpDevMode.dmReserved2));
Memo1.Lines.Add('PanningWidth: '+inttostr(lpDevMode.dmPanningWidth));
Memo1.Lines.Add('dmPanningHeight: '+inttostr(lpDevMode.dmPanningHeight));

end;
 
后退
顶部