想要天天向上,就要懂得享受学习。图老师为大家推荐用CB动态改变显示器分辨率,精彩的内容需要你们用心的阅读。还在等什么快点来看看吧!
【 tulaoshi.com - 编程语言 】
void __fastcall TForm1::btnGetClick(TObject *Sender)(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)
{
int x,y;
x = GetSystemMetrics(SM_CXSCREEN);
y = GetSystemMetrics(SM_CYSCREEN);
ShowMessage("显示器水平分辨率:" + AnsiString(x) + "nn显示器垂直分辨率:" + AnsiString(y));
}
//---------------------------------------------------------------------------
void __fastcall TForm1::DynamicResolution(int x,int y)
{
TDeviceMode lpDevMode;
bool Result;
Result = EnumDisplaySettings(NULL,0,&lpDevMode);
if (Result)
{
lpDevMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
lpDevMode.dmPelsWidth = x;
lpDevMode.dmPelsHeight = y;
Result = ChangeDisplaySettings(&lpDevMode,0);
// = DISP_CHANGE_SUCCESSFUL;
}
}
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
DynamicResolution(800,600);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn2Click(TObject *Sender)
{
DynamicResolution(1024,768);
}
来源:http://www.tulaoshi.com/n/20160219/1609329.html
看过《用CB动态改变显示器分辨率》的人还看了以下文章 更多>>