Y
Yan Yang
Guest
I am trying to move a static control to a new position when resizing the parent window, its size and horizonal position should not change, it should move along Y axis. I've checked that the position of the static control is updated when resizing the window, but it still stays in the same position on the screen. The code is below.
for (CWnd* pChild = GetWindow(GW_CHILD); pChild != NULL; pChild = pChild->GetWindow(GW_HWNDNEXT))
{
if (pChild->GetDlgCtrlID() == IDC_IMAGE)
{
pChild->GetWindowRect(&rcClient);
ScreenToClient(&rcClient);
rcClient.OffsetRect(0, dy);
:eferWindowPos(hDWP, pChild->m_hWnd, NULL, 0, 0, rcClient.Width(), rcClient.Height(), SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER);
}
}
How can I change the position of the static control on the screen?
Thanks in advance.
Continue reading...
for (CWnd* pChild = GetWindow(GW_CHILD); pChild != NULL; pChild = pChild->GetWindow(GW_HWNDNEXT))
{
if (pChild->GetDlgCtrlID() == IDC_IMAGE)
{
pChild->GetWindowRect(&rcClient);
ScreenToClient(&rcClient);
rcClient.OffsetRect(0, dy);
:eferWindowPos(hDWP, pChild->m_hWnd, NULL, 0, 0, rcClient.Width(), rcClient.Height(), SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER);
}
}
How can I change the position of the static control on the screen?
Thanks in advance.
Continue reading...