Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124

메임프레임이 차지하는 행의 수를 찾으려면

메임프레임이 차지하는 행의 수를 찾으려면

뺄셈과 나눗셈만으로 이 문제를 간단히 해결할 수 있습니다. 먼저

메임프레임과 클라이언트 영역의 높이를 계산합니다. 그 다음 프레임의

높이에서 클라이언트 영역의 높이, 프레임의 테두리, 캡션을 뺀 후 마지막으로

메뉴바의 높이로 나누면 됩니다.

int CMainFrame::GetMenuRows() const {

CRect rcFrame, rcClient;

GetWindowRect(rcFrame);

GetClientRect(rcClient);

return(rcFrame.Height() – rcClient.Height() –
::GetSystemMetrics(SM_CYCAPTION) –
(::GetSystemMetrics(SM_CYFRAME)*2))/

::GetSystemMetrics(SM_CYMENU);

Leave a Reply

Your email address will not be published. Required fields are marked *