在win98下面如何获得当前系统刷新率?(20分)

  • 主题发起人 主题发起人 yangmingnian
  • 开始时间 开始时间
Y

yangmingnian

Unregistered / Unconfirmed
GUEST, unregistred user!
&nbsp; &nbsp;在win2k下面可以声明如下API函数,但是win98下面好像不支持这个函数,<br>&nbsp; &nbsp; implementation<br>&nbsp; &nbsp; function EnumDisplaySettingsM(lpszDeviceName: PChar; iModeNum: Integer; var lpDevMode: TDeviceMode): Integer; stdcall; external 'User32.DLL' name 'EnumDisplaySettingsA';<br>&nbsp; &nbsp; ……<br>&nbsp; &nbsp; function GetFrequency:integer;<br>&nbsp; &nbsp; var lpDevMode:TDeviceMode;<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; EnumDisplaySettingsM(nil, -1, lpDevMode);<br>&nbsp; &nbsp; &nbsp; Result:=lpDevMode.dmDisplayFrequency;<br>&nbsp; &nbsp; end;<br>&nbsp; &nbsp; 有人说可以用EnumDisplaySettings函数实现,如下:<br>&nbsp; &nbsp; function GetFrequency:integer;<br>&nbsp; &nbsp; var lpDevMode:TDeviceMode;<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; EnumDisplaySettings(nil, 0, lpDevMode);<br>&nbsp; &nbsp; &nbsp; Result:=lpDevMode.dmDisplayFrequency;<br>&nbsp; &nbsp; end;<br>&nbsp; &nbsp; 但是这样只能获得系统默认的刷新率60Hz,而不是系统当前刷新率。<br>&nbsp; &nbsp; 请问在win98下面到底如何获得当前系统刷新率?
 
win98不可以的。。。<br>看看这里 &nbsp;: &nbsp;http://www.delphibbs.com/delphibbs/dispq.asp?lid=720320
 
&nbsp; &nbsp;function GetFrequency:integer;<br>&nbsp; &nbsp; var lpDevMode:TDeviceMode;<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; FillChar(lpDevMode, SizeOf(TDeviceMode), 0);<br>&nbsp; &nbsp; &nbsp; lpDevMode.dmSize := SizeOf(TDeviceMode);<br>&nbsp; &nbsp; &nbsp; EnumDisplaySettings(nil, ENUM_CURRENT_SETTINGS, lpDevMode);<br>&nbsp; &nbsp; &nbsp; Result:=lpDevMode.dmDisplayFrequency;<br>&nbsp; &nbsp; end;<br><br>试试看看<br>
 
[Error] Unit1.pas(62): Undeclared identifier: 'ENUM_CURRENT_SETTINGS'
 
多人接受答案了。
 

Similar threads

I
回复
0
查看
437
import
I
I
回复
0
查看
606
import
I
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部