关于ChangeDisplaySettings(50分)

  • 主题发起人 主题发起人 太阳火
  • 开始时间 开始时间

太阳火

Unregistered / Unconfirmed
GUEST, unregistred user!
我用ChangeDisplaySettings函数时,如果输入的参数显卡不支持,会有什么后果?<br>此函数会自动检测并且不改变设置,还是强制执行以致损伤硬件??<br>谢谢!<br>应该不是很难吧,所以分不多
 
Remarks<br><br>Using the DEVMODE returned by the EnumDisplaySettings function ensures that the DEVMODE passed to ChangeDisplaySettings is valid and contains only values supported by the display driver.<br>When the display mode is changed dynamically, the WM_DISPLAYCHANGE message is sent to all running applications with the following message parameters<br><br>你可以检测<br><br>procedure GetVideoModes(ModeList: TStringList);<br><br>var<br>&nbsp; i, j: integer;<br>&nbsp; MoreModes,<br>&nbsp; AddMode: boolean;<br>&nbsp; dm: TDeviceMode;<br>&nbsp; Mode: string;<br>begin<br>&nbsp; ModeList.Clear;<br>&nbsp; MoreModes := True;<br>&nbsp; Mode := ';<br>&nbsp; i := 0;<br>&nbsp; while MoreModes do<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; MoreModes := EnumDisplaySettings(nil, i, dm);<br>&nbsp; &nbsp; &nbsp; Mode := IntToStr(dm.dmBitsPerPel) + ' Bits Per Pixel ' +<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IntToStr(dm.dmPelsWidth) + ' x ' +<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IntToStr(dm.dmPelsHeight);<br>&nbsp; &nbsp; &nbsp; AddMode := True;<br>&nbsp; &nbsp; &nbsp; { Check to make sure this mode is not already in the list. }<br>&nbsp; &nbsp; &nbsp; for j := 0 to ModeList.Count-1 do<br>&nbsp; &nbsp; &nbsp; &nbsp; if Mode = ModeList[j] then<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddMode := False;<br>&nbsp; &nbsp; &nbsp; if AddMode then<br>&nbsp; &nbsp; &nbsp; &nbsp; ModeList.Add(Mode);<br>&nbsp; &nbsp; &nbsp; Inc(i);<br>&nbsp; &nbsp; end;<br>end;
 
但我的参数不是用EnumDisplaySettings返回的。
 
Return Values<br>The ChangeDisplaySettings function returns one of the following values.<br><br>Value Meaning <br>DISP_CHANGE_SUCCESSFUL The settings change was successful. <br>DISP_CHANGE_RESTART The computer must be restarted in order for the graphics mode to work. <br>DISP_CHANGE_BADFLAGS An invalid set of flags was passed in. <br>DISP_CHANGE_BADPARAM An invalid parameter was passed in. This can include an invalid flag or combination of flags. <br>[red]DISP_CHANGE_FAILED The display driver failed the specified graphics mode.[/red] <br>DISP_CHANGE_BADMODE The graphics mode is not supported. <br>DISP_CHANGE_NOTUPDATED Windows NT/2000: Unable to write settings to the registry. <br>
 
就是说会自动检测并且不改变设置罗?<br>谢谢zjan521,and tseug anyway.
 
后退
顶部