You could check the following variables to see what kind of events have taken place that frame. This should be done before updating the gui as the events are reset each frame
If app\MenuEvent=0 then no menu active.
if app\Event=0 then no events at all etc......
app\Event app\WindowEvent app\MenuEvent app\GadgetEvent
If app\MenuEvent=0 then no menu active.
if app\Event=0 then no events at all etc......