Re: How can I change the position where minimized windows go ?
On Jul 9, 3:08 am, "behzad" <bn at yahoo.com> wrote:
Hi,
How Can I Change the position where Minimized Windows go, i.e Can I make
them go to the upleft corner ?
Thanks
Agha Behzad,
You can but its not easy. You will have to catch the minimize message
in
the child frame, and then do some calculations to see where the
window
should go, and move it there, that calculation should probably happen
in the
main frame.
For example:
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
ON_WM_SYSCOMMAND()
END_MESSAGE_MAP()
void CChildFrame::OnSysCommand(UINT nID,LPARAM lParam)
{
CMDIChildWnd::OnSysCommand(nID,lParam);
if (nID == SC_MINIMIZE)
{
SetWindowPos(NULL,0,0,0,0,SWP_NOSIZE|SWP_NOZORDER);
}
}
As you notice it will simply stack the minimized windows one on top of
the
other, but it proves that it can be done. And one other thing, this
window
position has to be done only once pre window. From there on windows
remembers its minimized position and will return it there every time
the
user minimized the window after that. Also the user may want to move
the
window while it is minimized, which means that if they restore it and
then
minimize it again it should return to the position that the user has
dragged
it to, and you have to respect that.
AliR.