private void buttonMacroClose_MouseUp(object sender, MouseButtonEventArgs e) { Topmost = false; if (!Macros.CloseLastWindow()) { displayErrorMsg(); } Topmost = true; }