Post a WM_CANCELMODE message to wake up the internal menu handling code. This fixes the problem of a menu being orphaned when the parent window disappears, or if the parent loses focus.