static void Main(string[] args) { if (mutex.WaitOne(TimeSpan.Zero, true)) { if ((args.GetLength(0) == 1)) { HideVolumeOSDLib lib = new HideVolumeOSDLib(null); lib.Init(); if (args[0] == "-hide") { lib.HideOSD(); } else if (args[0] == "-show") { lib.ShowOSD(); } } else { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); using (ProcessIcon pi = new ProcessIcon()) { pi.Display(); if (!InitFailed) { Application.Run(); } } } mutex.ReleaseMutex(); } }
public ContextMenus(NotifyIcon ni) { hideVolumeOSDLib = new HideVolumeOSDLib(ni); }