日期:2014-05-19  浏览次数:20890 次

屏幕
如何设置屏幕分辩率?


------解决方案--------------------
http://www.codeproject.com/csharp/CSDynamicScrRes.asp?df=100&forumid=38736&select=800137

class User32
{
[DllImport( "user32.dll ")]
public static extern int EnumDisplaySettings (
string deviceName, int modeNum, ref DEVMODE devMode );
[DllImport( "user32.dll ")]
public static extern int ChangeDisplaySettings(
ref DEVMODE devMode, int flags);

public const int ENUM_CURRENT_SETTINGS = -1;
public const int CDS_UPDATEREGISTRY = 0x01;
public const int CDS_TEST = 0x02;
public const int DISP_CHANGE_SUCCESSFUL = 0;
public const int DISP_CHANGE_RESTART = 1;
public const int DISP_CHANGE_FAILED = -1;
}