What is the best practices for laying out child windows (common controls) in a dialog box or main window? I mean is there a binding mechanism which would fix a relative positions of the control to parent window's border like in WPF. And during window resize the child control would resize together with the main window. Currently I have this:
As you can see from the red lines it does not look pretty when I am resizing parent window of a list view control. I would like to bind for example ListView's right side to DialogBox's right border and similarly other controls.
I know that I can play around with GetWindowRect, GetClientRect and MoveWindow functions. But is this the correct way?
Currently I am working with pure Win32 Api without MFC.