Resizing windows
-
if it's a dialog you should be able to set the appropriate border style property. Or if not, try handling the WM_SIZE (or WM_RESIZE) message so that it calls a this->Move(0,0,100,100) or whatever your original size is, or try handling it so that it does nothing. If it's broken, I probably did it bdiamond
-
Depends on what kind of window library you're using. (MFC? WTL? Raw Win32?) If you're using the raw Win32 API, you simply set the appropriate window style when calling CreateWindow() or CreateWindowEx(). It's the WS_THICKFRAME style that adds the resizable border, so don't use it. Also don't use WS_TILEDWINDOW or WS_OVERLAPPEDWINDOW, as those styles include use WS_THICKFRAME. Try (WS_OVERLAPPED | WS_MINIMIZEBOX | WS_SYSMENU) as your window style. It will probably be exactly what you want.
-
if it's a dialog you should be able to set the appropriate border style property. Or if not, try handling the WM_SIZE (or WM_RESIZE) message so that it calls a this->Move(0,0,100,100) or whatever your original size is, or try handling it so that it does nothing. If it's broken, I probably did it bdiamond
It is SDI application with CFormView. I want to prevent resizing the main window. I tried handling WM_SIZE in CMainFrame and CFormView to do nothing, but it didn't work out. If I put MoveWindow() then the window starts resizeing but when you release a mouse button it goes back. But this solution is not what I wanted. Is there a parameter that you can pass to Create() so it makes window non-resizeable, or some similar solution?
-
Depends on what kind of window library you're using. (MFC? WTL? Raw Win32?) If you're using the raw Win32 API, you simply set the appropriate window style when calling CreateWindow() or CreateWindowEx(). It's the WS_THICKFRAME style that adds the resizable border, so don't use it. Also don't use WS_TILEDWINDOW or WS_OVERLAPPEDWINDOW, as those styles include use WS_THICKFRAME. Try (WS_OVERLAPPED | WS_MINIMIZEBOX | WS_SYSMENU) as your window style. It will probably be exactly what you want.
-
It is SDI application with CFormView. I want to prevent resizing the main window. I put parameters you told me for CMainFrame and it worked. Thanx.
Glad it worked for you. :)
-
Try handling the WM_SIZING message.
...Plug & Pray... X|