Win32 Window Docking System

Jan 30, 2015

This demo shows a win32 docking system implementation. It's based on a custom DockHost control to host the docked window, and a DockDiamond control to guide the user when docking floating windows.

This video was made a long time ago, but I've since rewrote parts of the system and the demo, and now it's less functional! It is a good starting point however for someone trying to implement something similar. Currently I need to focus on other projects, but if the need arises to use this, I will work on it further.

Currently it is still missing the following features

  • Loading/Saving window layouts.
  • Handle creating dock host controls when needed in addition to the one you'd normally create inside the main window. For example, in the video, notice how one floating window was docked beside another floating window. Doing that requires creating a dock host control to host them both. The implementation used in the video was for testing purposes and was later removed.
  • Modify the DockHost control to implement tabbed docking (multiple child windows in the same leaf node).
  • The option for a different window subclassing mechanism that doesn't use the user data field of windows, as that is often used for other purposes in large applications or frameworks.

The demo and system use code-section's toolbox. A working copy is included for convenience, but consider checking the toolbox out on bitbucket here.

Download Demo srx + exe

Don't hesitate to comment if you have any questions/suggestions.