현재 윈도우 해상도 얻기
1. GetSystemMetrics()
int nWidth = GetSystemMetrics(SM_CXSCREEN);
int nHeight = GetSystemMetrics(SM_CYSCREEN);
(결과) nWidth : 1280, nHeight : 1024
2. GetWindowRect()
RECT rect;
::GetWindowRect(::GetDesktopWindow(), &rect);
(결과) Top : 0, Bottom : 1024, Left : 0, Right : 1280
3. EnumDisplaySettings()
DEVMODE mode;
::EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS, &mode);
UINT nWidth = mode.dmPelsWidth;
UINT nHeight = mode.dmPelsHeight;
(결과) nWidth : 1280, nHeight : 1024
작업 표시줄 제외한 윈도우 영역 크기 얻기
RECT rect;
SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);
(결과) Top : 0, Bottom : 994, Left : 0, Right : 1278
트레이 영역 크기 얻기
HWND hTrayP = ::FindWindow("Shell_TrayWnd", NULL);
HWND hTrayC = ::FindWindowEx(hTrayP, NULL, "TrayNotifyWnd", NULL);
if(hTrayC)
::GetWindowRect(hTrayC, &rect);
(결과) Top : 994, Bottom : 1024, Left : 1114, Right : 1280
※ 결과 : 1280*1024 해상도 기준
출처: http://blog.naver.com/freessul01?Redirect=Log&logNo=100039634640
'MFC' 카테고리의 다른 글
각종 컨트롤의 배경색 변경하기 (0) | 2011.08.30 |
---|---|
스트링 형변환 (0) | 2011.08.30 |
gdiplus jpeg 이미지 위에 문자열 추가 후 저장하는 방법 (0) | 2011.08.26 |
마우스 press relese 이벤트 직접 설정하기 (0) | 2011.08.26 |
윈도우 종료 하기 (0) | 2011.08.26 |