#CToolbar and CMDIChild
I am writing code to allow me to save am MDI child window position and restore
it next time a document is opened (it is saved in the document). I now have
this working except for the fact that I need to "factor-out" the vertical size
of the toolbar.
It seems that SetWindowPos() will place an MDI window at the coordinates you
specify relative to any classes generated by the CControlBar class (CToolbar,
CStatusBar, etc.) GetWindowRect() in conjuction with ScreenToClient() will get
the Window coordinates relative to the top of the MDI client window. What I
want to do is "normalize" the window position so that when I use
GetWindowRect() and the toolbar is displayed, I will always subtract the size
of the toolbar. This "normalization" would be very similar to the way Visual
Basic treats the "threed.vbx" widget in an MDI window. In VB, all window
coordinates are normalized so that the start of the window is at the bottom of
the toolbar (frame) object.
From within my view (or document, app, frame, etc.), how can I figure out the
number and size of the toolbars I have at the top of my window?
Thanks,
Matt Ferm