ShowDeviceInformation
来源:互联网 发布:钢铁侠玩具模型淘宝 编辑:程序博客网 时间:2024/04/28 20:30
void ShowDeviceInformation(HWND hWnd)
{
HDC hdc = GetDC(NULL);
int width = GetDeviceCaps(hdc,HORZRES);
int height = GetDeviceCaps(hdc,VERTRES);
TCHAR wide[256];
TCHAR high[256];
wsprintf(wide, _T("%s%d/n"),_T("The Device width is: "),width);
wsprintf(high, _T("%s%d"),_T("The Device heigh is: "),height);
lstrcat(wide,high);
MessageBox(hWnd, wide,_T("Device Information"),0|MB_ICONINFORMATION);
ReleaseDC(NULL,hdc);
}