MFC 下调整xp,win7分辨率 代码

	DEVMODE devmode = {0};
	devmode.dmSize = sizeof(DEVMODE);
	devmode.dmFields = DM_PELSHEIGHT
		| DM_PELSWIDTH
		| DM_DISPLAYFREQUENCY
		| DM_BITSPERPEL;
	int nWidth = 1024;//宽
	int nHeight = 768;//高
	int nFrequency = 60;//刷新频率HZ
	int nPerPel = 32;//颜色质量8,16,32

	devmode.dmPelsWidth = nWidth;
	devmode.dmPelsHeight = nHeight;
	devmode.dmDisplayFrequency = nFrequency;
	devmode.dmBitsPerPel = nPerPel;

	ChangeDisplaySettings(&devmode,CDS_UPDATEREGISTRY);//CDS_TES可以询问窗口

你可能感兴趣的:(MFC 下调整xp,win7分辨率 代码)