change client rectangle?

Started by
1 comment, last by comservlant 19 years, 9 months ago
I have a simple (overlapped) win32 window I print text to. On WM_CREATE I first initialize a toolbar window, then get the text metrics for the font I want and resize the main window to handle the length of a line of text. After initialization in WM_CREATE, I first call ShowWindow() on the toolbar, then force a repaint of the main window with InvalidateRect(). When the window paints, the text is overwritten by the toolbar, the client rect still thinks it has the whole main window to display in, is there a way to resize the client area of a window? Do I have to send a WM_SIZE to the toolbar?, If so what do I tell it in WPARAM/LPARAM? Thanks for any help, George
Advertisement
You can use AdjustWindowRect() to help change the window's size so that the client has the desired dimensions. The input rectangle is the desired client dimensions and given the window's styles the function will modify the RECT to be the dimensions of the entire window for you to use in SetWindowPos().
Many thanks, Colin. I'll use it directly.

Cheers,

George

This topic is closed to new replies.

Advertisement