Are you using the menu designer (MODIFY MENU)? This will create all the required code. Or perhaps I misunderstood your question: I think that if you select a menu item, you want a lower-level menu to appear?
>Dear Experts
>
>I have following popup menu. I want to select bar 2 programatically.
>I mean when this popup menu appears then control automatically should go to bar 2, entitled "The Software".
>And how to findout which bar is selected?
...
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)