0

I have a CDialog based application that has two side-by-side CTreeCtrl and both trees have nearly identical CToolbars above them. Currently, when the dialog receives a message from one of the toolbars, it passes the message to the appropriate tree. I'd like to create a new class, probably derived from a CWnd, that contains one CTreeCtrl and one CToolbar. This new class would pass messages from its one toolbar to its one tree. It would remove a lot of redundant code (presumably) simplify ongoing development.

My question is, is CWnd the appropriate class for this task (to combine a CTreeCtrl and CToolbar)?

Thanks!

Steve A
  • 1,798
  • 4
  • 16
  • 34

1 Answers1

0

Yes, CWnd is the perfect container to encapsulate multiple controls. It was a bit of a challenge to register my class, but after that, the messaging worked great.

Steve A
  • 1,798
  • 4
  • 16
  • 34
  • 1
    Make sure to set `WS_EX_CONTROL­PARENT` style for the `CWnd` so TAB navigation works as expected. – zett42 Apr 30 '19 at 09:39