Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Window resizing 1

Status
Not open for further replies.

katenka5

ISP
Nov 30, 2001
15
US
I want my window to return to its original size if the user tried to resize it.
Code:
afx_msg void CWind::OnSize(UINT,int x,int y) 
{
 
}
 
Not to try and over-simplify things I don't know, but why not just make the window not resizable? Then you don't have to worry about them resizing it in the first place.
 
What is the shortest way to make the window non-resizable?
The function I found takes about 3 pages long that is why I thought about that kind of a cheater way to resize the window back when the user tried to change the size.
 
How are you creating the window?

You should be able to just set the appropriate Style flag while creating it. If it's a dialog box that you built in the designer, should be easy to change in the properties dialog. If you built it manually, then check out the styles that does what you want, maybe WS_DLGFRAME (double border but no title)will work.
 
This is how I create it:

Create (NULL,"Lines",WS_OVERLAPPEDWINDOW,CRect(100,100,480,540));
 
WS_OVERLAPPEDWINDOW has the style of WS_THICKFRAME as part of it.

Try using a Create like:
Create (NULL,"Lines",
WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|
WS_MINIMIZEBOX|WS_MAXIMIZEBOX,
CRect(100,100,480,540));

It'll give you everything WS_OVERLAPPEDWINDOW has except for the sizeable border.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top