I have an MDI application that provides automation for enumerating command information.
To implement the API, when the automation request is for a document type that is not the active document, I am creating a command bars object and then a ribbon and populating the ribbon. I have to set the site of the ribbon to avoid a crash in some CodeJock code, which I set to be the mainframe (not sure what else I can set it to). I also set the ribbon visible property to FALSE (failure to do so results in the created ribbon partially displaying at the top of, and across the entire desktop, which I suppose happens since the frame already has a command ribbon).
When I am done enumerating the controls, I delete the command bars object and have verified the ribbon is deleted too. I only create the temp bars and ribbon if the request is not for the current document type (otherwise I just use the frame's ribbon that is already populated for the doc type).
However, now I am sometimes seeing the old XP blue themed caption bar appearing over the application's current ribbon temporarily. Moving the cursor over the ribbon displays portions of the ribbon over the old blue caption bar.
Is it possible to have more than one ribbon whose site is the frame window? What can I do to avoid the old caption displaying over the actual ribbon the frame has added to its command bars collection?
|