How to handle control bar's show/hide commands and update their associated command states in docking site?

Professional User Interface Suite, Copyright FOSS Software Inc. Help Published with Permission.

These commands make each control bar visible/invisible. They are usually marked with check marks, which indicates visibility of the bars. Every docking bar has its own unique dialog control identifier and the corresponding menu command in the docking site. In this case, the context menu with the list of all the docking bars can be activated on every frame point. So, to set the correct check mark for the "Show/Hide" command of the bar, you should add the following two lines to the frame's message map:

ON_COMMAND_EX( ID_BAR_... , OnBarCheck )
ON_UPDATE_COMMAND_UI( ID_BAR_... , OnUpdateControlBarMenu )