public void Exec(vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled) { // Only toggle realtime mode in mighty mode if (!_client.IsRunning || _client.MMConfiguration.BuildExecutables.Count() == 0) { return; } var newState = _client.MMConfiguration.RealtimeFeedback ? "off" : "on"; try { var ptr = GetForegroundWindow(); var image = newState == "on" ? "maniac.png" : "mighty.png"; var win = new TransparentImageWindow(image); win.Show(); SetFocus(new HandleRef(null, ptr)); Logger.Write("Toggling realtime mode " + newState); _client.MMConfiguration.OverrideRealtimeFeedback(!_client.MMConfiguration.RealtimeFeedback); _client.RefreshConfig(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }