본문 바로가기

프로그래밍 언어들/MFC ( Visual C++ )

[MFC(Visual C++)] 바탕화면의 해상도 얻어오기

// CWindowDC 형식으로 DC를 얻어온다.

HDC hScrDC = ::GetDC(NULL);


// 현재 스크린의 해상도를 얻어온다.

int nWidth = ::GetDeviceCaps(hScrDC, HORZRES);

int nHeight = ::GetDeviceCaps(hScrDC, VERTRES);