Mark Williamson
April 5th, 1999, 08:18 AM
I am trying to use the GetClientRect() function to calculate the dimensions of a window. However, it doesn't seem to work and I don't know why. Following is a snippet of my code:
void CTestView::CreateCalendar()
{
RECT rect;
GetClientRect(&rect);
m_calendar.Create("Calendar Prog", WS_CHILD | WS_VISIBLE | WS_BORDER,
CRect(rect.left, rect.top, rect.right, rect.bottom),
this, IDC_CALENDAR);
}
As you can see I am trying to make the calendar occupy the full window.
Also can someone please tell me how to give an edit box focus. I am sure you use the SetFocus() function but I am unsure as to how to use it.
Thanks
Mark
void CTestView::CreateCalendar()
{
RECT rect;
GetClientRect(&rect);
m_calendar.Create("Calendar Prog", WS_CHILD | WS_VISIBLE | WS_BORDER,
CRect(rect.left, rect.top, rect.right, rect.bottom),
this, IDC_CALENDAR);
}
As you can see I am trying to make the calendar occupy the full window.
Also can someone please tell me how to give an edit box focus. I am sure you use the SetFocus() function but I am unsure as to how to use it.
Thanks
Mark