Dynamic Child Window Repositioning | CodeGuru

Dynamic Child Window Repositioning

. This article replaces my former article "Dynamic child window positioning" (cdxCDynamicControlsManager). See the what’s new section to find our whether it’s worth changing your code. What’s this article about ? I’ll introduce you to some of my code that has will make your windows support automatic repositioning of their child controls. I’ll call such […]

Written By
CodeGuru Staff
CodeGuru Staff
Feb 29, 2000
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

.

This article replaces my former article "Dynamic child window positioning"
(cdxCDynamicControlsManager).
See the what’s new section to find our whether it’s worth changing
your code.

What’s this article about ?

I’ll introduce you to some of my code that has will make your windows support automatic
repositioning of their child controls.
I’ll call such windows dynamic (since they don’t have a static
size and child control orderung but dynamic ones):

cdxCDynamicWnd-small.gif (2466 Byte)   => cdxCDynamicWnd-big.gif (2928 Byte)

What classes are part of this release ?

  • cdxCDynamicWnd, cdxCDynamicWndEx
    General base class(es) used to implement dynamic child window repositioning in any CWnd
    derived class.
  • cdxCDynamicDialog
    A CDialog replacement that allows you to dynamically move your controls.
  • cdxCDynamicChildDlg
    The same as a dialog base-class for child window dialogs.
  • cdxCDynamicFormView
    A CFormView, now supports the scrollbars, knows its own size perfectly and stuff
    !
  • cdxCDynamicPropSheet, cdxCDynamicPropPage
    The dynamic CPropertySheet / CPropertyPage replacement.
  • cdxCDynamicBar, cdxCDynamicBarDlg and cdxCDynamicBarT<>
    A controlbar with an embedded dialog that is dynamically moving its childs.
    The bar itself is derived from the CSizingControlBar published at codeguru’s by Cristi Posea
Advertisement

What’s new in contrast to my former cdxCDynamicControlsMananger +
associated classes ?

  • New and better code 🙂
    This is why we can not simply replace a cdxCDynamicControlsManager code into a
    cdxCDynamicWnd code 🙁
  • Now works with HWNDs and IDs instead of CWnds.
    Therefore you don’t need to explicitely create DDX control variables anymore. *
  • Supports "dynamic maps" – as known from message map macros.
    These maps map IDs to a resizable control. *
  • Now uses ::DeferWindowPos() instead of ::SetWindowPos() to decrease
    flickering (for all classes). *
  • Anti-Flickering system for cdxCDynamicDialog (looks much better !). *
  • Supports scrolling in CFormView (and any other class, if you enable it
    by hand). *
  • "Auto-Positioning" feature for dynamic dialogs & property
    pages. *
  • Support for dialogs that are meant to be "child control dialogs"
    – if often embedd dialogs and this class helps to make your child controls remain in a
    suitable place 🙂
  • A ControlBar solution.

* ~ Suggested by users of my cdxCDynamicControlsManager 🙂

However, since I rewrote much of the code of the cdxCDynamicControlsManager, you cannot
switch from that class to my new cdxCDynamicWnd without further work to be done;
converting a cdxCSizingDialog into a cdxCDynamicDialog would need help by you.

A documentation file is included in the sub-directory codex/doc/cdxCDynamicWnd-DOC.html

Any suggestions & bug-reports are welcome.

Downloads

Download project – 110 Kb

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.