Vassili Philippov (vasja@spbteam.com), April 02, 2003.
I want to make two command bars in my application like it is implemented in Pocket Word. The second one should slide up automatically when SIP is shown. How can I do it?
Creating the second command bar is simple. Here is a sample code:
Now you have to move it to the right. To remove the unnecessary black frame from
the left and right borders you should set the left coordinate of the command bar
to -1 and the width to screen width + 2.
You should also remember about SIP when positioning the second command bar. If SIP is shown then the second command bar should be placed above it. You can use the SipGetInfo function to test if SIP is shown and to get its height.
The last thing you should worry about is moving the second command bar when SIP is shown or hidden. When SIP is shown or hidden your application receives a WM_SETTINGCHANGE message with wParam equal to SPI_SETSIPINFO. You should also check if SIP is shown or not and change the corresponding position of the command bar.
You can download a sample project that demonstrates working with three command bars - TestSecondToolbar.zip - 16 Kb. It contains a reusable CCommandBarSet class that you may use for your projects to organize several command bars. This class encapsulates logic of the command bar positioning.