Dave's Brain

Browse - Programming Tips - How do I resize a window?

Date: 2008jul7
Platform: win32
OS: Windows
Level: beginner

Q.  How do I resize a window?

A.  Use the MoveWindow() function.
Somewhat inconveniently, this requires the position of the window (x,y)
so you can not just set the size of a window.  If you only to want
to simply set the width and height of a window you need to first
get the width in order to call MoveWindow().

const BOOL bRepaint = TRUE; ::MoveWindow(hwnd, x, y, width, height, bRepaint);

Add a comment

Sign in to add a comment
Copyright © 2008-2018, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.