Title: RE: [msvc] ToolBar Positioning

> I have a floating toolbar that is dynamically changed based on user
> input.
> If I do a GetWindowRect() for the toolbar, MSDN indicates
> that the border,
> caption etc is included in the rect information returned.  It
> appears that,
> in my case, the border and caption are not included as using
> the returned
> cooredinates to reposition the toolbar causes a position
> change equal to the
> width of the border in the x direction and equal to the height of the
> caption in the y direction.  How can I get the dimensions of
> the border and
> caption so that I may reposition the toolbar back to its
> original position?

It's been quite a bit of time since last I played with the GUI like
this, but I suppose that the border and caption do not belong to the
toolbar's window when floating.  I assume you need to call GetParent( )
to get the window on which the toolbar is resting, and then call
GetWindowRect( ) on that window.  I have no idea of exactly which class
in the MFC hierarchy implements that functionality, but I suppose you
can simply use the CWnd version for your purpose.

<disclaimer>
The author of the above content is suffering from sleep deprivation and
a huge work overload and is at least one week late for all the deadlines
he'll be facing - which are near, unfortunately.  Because of the
aforementioned reasons, as well as others, the auther cannot guarantee
the above content's correctness, or even relevance to the subject.
Please use the good-n-old "give it a shot and let us know if it worked"
strategy.

Thanks for your cooperation in advance.
</disclaimer>

:-)

-------------
Ehsan Akhgari

List Owner: [EMAIL PROTECTED]

[ Email: [EMAIL PROTECTED]; [EMAIL PROTECTED] ]
[ WWW: http://www.beginthread.com/Ehsan ]

It is dreadful to die of thirst in the sea. Do you have to salt your
truth so much that it can no longer even - quench thirst? -Beyond Good
And Evil, F. W. Nietzsche

Reply via email to