What exactly do you mean, like getting smaller when the window gets smaller? Like autowrapping text so you don't need a scrollbar?
If you want to autowrap then this:
Code:
hwndEdit = CreateWindow (TEXT ("edit"), NULL,
WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL | //<---------------both H and V scrolls
WS_BORDER | ES_LEFT | ES_MULTILINE |
ES_AUTOHSCROLL | ES_AUTOVSCROLL,//<-------------------Auto scrolling
0, 0, 0, 0, hwnd, (HMENU) ID_EDIT,
((LPCREATESTRUCT) lParam) -> hInstance, NULL) ;
Should be this:
Code:
hwndEdit = CreateWindow (TEXT ("edit"), NULL,
WS_CHILD | WS_VISIBLE | WS_VSCROLL | //<---------------Just V scroll
WS_BORDER | ES_LEFT | ES_MULTILINE
| ES_AUTOVSCROLL,//<-------------------Auto scrolling(vertical only)
0, 0, 0, 0, hwnd, (HMENU) ID_EDIT,
((LPCREATESTRUCT) lParam) -> hInstance, NULL) ;
If you mean simply autoresizing the example prog I gave you did that, its contained in the WM_SIZE message like so:
Code:
MoveWindow (hwndEdit, 0, 0, LOWORD (lParam), HIWORD (lParam), TRUE) ; //Place edit control in top left of window
//resizes to size of window
So if you know a specific size you want to remake your window simply change these parameters:
LOWORD(lParam) - width
HIWORD(lParam) - height
Happy coding!