The MENUSTATE flag is set by Intuition in window.flags when the menus of that window are in use. Beware: in typical event driven programming, such a state variable is not on the same timetable as the application's input message handling, and should not be used to draw profound conclusions in any program. Use idcmp_menuverify to synchronize with the menu handling.