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> i, j: integer;<br> MoreModes,<br> AddMode: boolean;<br> dm: TDeviceMode;<br> Mode: string;<br>begin<br> ModeList.Clear;<br> MoreModes := True;<br> Mode := ';<br> i := 0;<br> while MoreModes do<br> begin<br> MoreModes := EnumDisplaySettings(nil, i, dm);<br> Mode := IntToStr(dm.dmBitsPerPel) + ' Bits Per Pixel ' +<br> IntToStr(dm.dmPelsWidth) + ' x ' +<br> IntToStr(dm.dmPelsHeight);<br> AddMode := True;<br> { Check to make sure this mode is not already in the list. }<br> for j := 0 to ModeList.Count-1 do<br> if Mode = ModeList[j] then<br> AddMode := False;<br> if AddMode then<br> ModeList.Add(Mode);<br> Inc(i);<br> end;<br>end;