Dear Hakan,
You could use oWindow:bMMoved to check if the mouse was moved over the window
//
MENUITEM "Minimize" ACTION o:oWnd:oWnd:Minimize() // oWindow:Minimize // So oWindow is object window principal and static variable
oWindow:bLostFocus := { || ...... }