it starts driving me nuts, but I cann't figure out how to keep position of a child control in a z-order. At design time in MFC dialog resource editor I have STATIC control (descendant of CStatic) at the bottom (tab order Nr. 1), ie. it's overlapped by other controls like buttons, listbox etc.
At runtime, dialog handles WM_TIMER message and in OnTimer handler there gets the STATIC control moved:
void CTestMFCDlg::OnTimer(UINT_PTR nIDEvent)
{
...
m_stMyStatic.SetWindowPos(&this->wndBottom, xpos, ypos, 0, 0, SWP_NOSIZE);
...
}
After the call of SetWindowPos for the sublassed CStatic control, it's drawed over other controls in a dialog, no matter what I'm passing in the first argument.
Any idea how to keep the control at the bottom of Z-order all the time ?