Sign in to follow this  
comservlant

change client rectangle?

Recommended Posts

comservlant    122
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

Share this post


Link to post
Share on other sites
Colin Jeanne    1114
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().

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this