resizing a window
-
i don't want a window to be resized. i want it to be fixed but i am not getting the way to do this stuff. is there anyone who can guide me
The easiest way is not to use the WS_THICKFRAME style when creating the window. In the dialog resource editor, it's a property of the dialog box (in the styles tab, select the 'Border' dropdown and choose 'Thin'). In code, you can either remove the WS_THICKFRAME style in the call to CreateWindow (but note that WS_THICKFRAME is included in WS_OVERLAPPEDWINDOW) or, in MFC, you can override PreCreateWindow and modify the style there:
cs.style &= ~WS_THICKFRAME;
If you want a non-resizeable window but you want to keep the thick frame, you'll have to do something slightly more complicated involving WM_NCHITTEST.
"We are the knights who say Ni" (The Knights Who Say Ni)
-
i don't want a window to be resized. i want it to be fixed but i am not getting the way to do this stuff. is there anyone who can guide me
There are a few ways that jump to my mind. You could override OnGetMinMaxInfo / WM_GETMINMAXINFO to restrict the resizability of your window. Change the window style (in PreCreateWindow) so you don't have a border to resize. Override OnNcHitTest / WM_NCHITTEST so it returns HTCAPTION instead on HTTOP etc so you could move your window by dragging on the border rather than resizing it. A word of warning though. In general, I like being able to resize things, and I'm not alone. Don't break the windows paradigm unless you have a _really_ good reason. Good luck, Iain.