thanks for ur help dear,
but here that functionality just u told about exec() is already implemented.
after opening the menu if I click else where then it automatically gets hidden.
Is there any other way????