or post a WM_CANCELMODE event to the owner of the menu. I guess this is a graceful way according to MSDN.