Hi, I was just wondering how I can make sure that the user can't resize a window that I make. It just sucks when I make a program and everything looks nice, but then looks awful if the user resizes the window.
Hi, I was just wondering how I can make sure that the user can't resize a window that I make. It just sucks when I make a program and everything looks nice, but then looks awful if the user resizes the window.
Last edited by Hunter2; 05-08-2002 at 08:40 PM.
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
Windows created with WS_POPUPWINDOW or WS_OVERLAPPED can't be resized.
OR you could always just have a large section of your drawing code (how the window is setup -- or how it looks) in your windows procedure function. Under WM_PAINT specifically. This way if the window is resized, or if the window is maximized, etc. its redrawn to fit the window.
So instead of specifying specific co-ordinates for things in your window, change it so then you use other methods. To put text in the center of your window, use the following code:
HDC hdc;
switch(message)
{
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
GetClientRect(hwnd, &rect);
DrawText(hdc, TEXT("Here is text in the center of my window."), -1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
EndPaint(hwnd, &ps);
}
So each time the window is redrawn (say after someone resizes it), the text will be redrawn in the center of the screen. Just an idea!