Click to See Complete Forum and Search --> : How to move a toolbar?


yaniv_av
March 26th, 2009, 10:10 AM
Hi,

I created a standard win32 toolbar with CreateToolbarEx.
By default, the toolbar is located at the top of the window.
How can I move it to a different location in the window?
I tried using MoveWindow (with the handle to the toolbar which I got from CreateToolbarEx) - but it didn't work.

Please notice that it's a WIN32 question - not MFC!

Thanks!

nightpwn2
March 26th, 2009, 11:56 PM
Toolbars in dialog boxes can't be moved as a heads up, just so you know :].

but in all other cases,

Send TBN_BEGINADJUST then right after sending that send TBN_INITCUSTOMIZE. Crap, I forgot the rest, Just read up on MSDN about Toolbars, Hopefully that answers your question.

http://msdn.microsoft.com/en-us/library/bb760446(VS.85).aspx

ovidiucucu
March 27th, 2009, 09:06 AM
TBN_BEGINADJUST and TBN_INITCUSTOMIZE are notifications sent via WM_NOTIFY message to the parent window as a result of a user action and have not to be explicitly sent from within your application.

To see how to set the toolbar position take a look at Basic Common Control Styles (http://msdn.microsoft.com/en-us/library/bb775498(VS.85).aspx), CCS_NOPARENTALIGN, CCS_BOTTOM, and so on