Simple Question: Resizing:
-
hey folks, i know how to create a window using create and giving it a rectangle region:
Create(NULL, "Windows Application", WS_OVERLAPPEDWINDOW, CRect(120, 100, 700, 480), NULL);
but how do I change the rectangle region... I mean clicking on a button and resizing the window to half or stuff (better to a Rectangle I calculate)??? I know it's simple but couldn't find a link thx in advance zqueezy -
hey folks, i know how to create a window using create and giving it a rectangle region:
Create(NULL, "Windows Application", WS_OVERLAPPEDWINDOW, CRect(120, 100, 700, 480), NULL);
but how do I change the rectangle region... I mean clicking on a button and resizing the window to half or stuff (better to a Rectangle I calculate)??? I know it's simple but couldn't find a link thx in advance zqueezywell now I Found MoveWindow to SetThatRegion but all I get is a "Debug Assertion Failed!"... I actually wanted to to resize a subelement of my DialogClass. So I did a movewindow in my Dialog::OnSize(...) method. I guess the error comes from the initialization where there isn't any SubElement (although it's initialized but maybe not visible?) because GetWindowRect also fails with the same assertion failed
-
hey folks, i know how to create a window using create and giving it a rectangle region:
Create(NULL, "Windows Application", WS_OVERLAPPEDWINDOW, CRect(120, 100, 700, 480), NULL);
but how do I change the rectangle region... I mean clicking on a button and resizing the window to half or stuff (better to a Rectangle I calculate)??? I know it's simple but couldn't find a link thx in advance zqueezy -
SetWindowPos
[^] :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
-
hey folks, i know how to create a window using create and giving it a rectangle region:
Create(NULL, "Windows Application", WS_OVERLAPPEDWINDOW, CRect(120, 100, 700, 480), NULL);
but how do I change the rectangle region... I mean clicking on a button and resizing the window to half or stuff (better to a Rectangle I calculate)??? I know it's simple but couldn't find a link thx in advance zqueezyHi, another way to do this is to change the CSize into ChildFrm.cpp in the function PrecreateWindow () For xample: i make different window sizes depending of the parent element of the window
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{ if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;//Set the configuration for the NewViews CMDIChildWnd\* pMDIActive = MDIGetActive(); CDocument\* pDoc = pMDIActive->GetActiveDocument(); if ((pDoc) && (pDoc->m\_szNewFrameName != "")) { cs.style = WS\_SYSMENU | WS\_CAPTION | WS\_OVERLAPPED; if (pDoc->m\_pObject1 || pDoc->m\_pObject2) { cs.cx = 415; cs.cy = 260; } else if (pDoc->m\_pObject3->m\_nType == 0) { cs.cx = 517; cs.cy = 421; } else if (pDoc->m\_pObject3->m\_nType == 2) { cs.cx = 610; cs.cy = 435; } cs.lpszName = pDoc->m\_szNewFrameName; } return TRUE;
}
With this I put the caption of the new view according to the name of the element and some other parameters, and the size according to the type of the element.
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?