'영역'에 해당되는 글 1건

  1. 2007.01.15 각종 윈도우 영역 크기 얻기...

현재 윈도우 해상도 얻기

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 해상도 기준
※ 자료 출처 : 데브피아1, 데브피아2, Jiniya.net
 

Posted by Gungume
,