Can an LSUIElement app decide to show a menu bar and then hide it again?

I would like for my app to have a menu bar under certain circumstances, but not most of the time. Is this possible?

Can an LSUIElement app decide to show a menu bar and then hide it again?
 
 
Q