Trying to slide a window up and down. But trying to make it resize at the same time so the bottom stays at same place. Problem im having is that when the window is sliding up the bottom part flickers 5pixels or so. The window slides down with no problems.
here is part of the code im doing it with a dialog box that is a resource.
int w = 500;
int h = 150;
int Speed = 10;
bool StartSlide()
{
m_pDlg->GetWindowRect(&m_MyPos);
for (int i = 0; i <= h; i += 5)
{
Sleep(Speed);
SetWindowPos(m_pDlg, m_MyPos.left, m_MyPos.top - i, w, i, SWP_SHOWWINDOW | SWP_NOOWNERZORDER | SWP_NOACTIVATE);
}
return true;
}
bool Close()
{
RECT thisWindow;
GetWindowRect(&thisWindow);
for (int i = 0; i <= h; i += 5)
{
Sleep(Speed);
SetWindowPos(m_pDlg, thisWindow.left, thisWindow.top + i, w, h - i, SWP_SHOWWINDOW | SWP_NOOWNERZORDER | SWP_NOACTIVATE | SWP_NOREPOSITION);
}
return true;
}