diff --git a/.gitignore b/.gitignore index 680f7ae06..395d08fcf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.user *.suo /Bin -/Obj \ No newline at end of file +/Obj +/.vs \ No newline at end of file diff --git a/GUI/NotifyIconAdv.cs b/GUI/NotifyIconAdv.cs index e40782d3f..34f0af63c 100644 --- a/GUI/NotifyIconAdv.cs +++ b/GUI/NotifyIconAdv.cs @@ -525,31 +525,17 @@ private void UpdateNotifyIcon(bool showNotifyIcon) { if (showNotifyIcon && icon != null) { if (!created) { - int i = 0; - do { - created = NativeMethods.Shell_NotifyIcon( - NativeMethods.NotifyIconMessage.Add, data); - if (!created) { - System.Threading.Thread.Sleep(200); - i++; - } - } while (!created && i < 40); + NativeMethods.Shell_NotifyIcon( + NativeMethods.NotifyIconMessage.Add, data); + created = true; } else { NativeMethods.Shell_NotifyIcon( NativeMethods.NotifyIconMessage.Modify, data); } } else { if (created) { - int i = 0; - bool deleted = false; - do { - deleted = NativeMethods.Shell_NotifyIcon( - NativeMethods.NotifyIconMessage.Delete, data); - if (!deleted) { - System.Threading.Thread.Sleep(200); - i++; - } - } while (!deleted && i < 40); + NativeMethods.Shell_NotifyIcon( + NativeMethods.NotifyIconMessage.Delete, data); created = false; } }