二重起動を検知して最小化されている場合は表示する
Mutex mutex = new Mutex(true, "MainMenu", out createdNew); if (!createdNew) { var proc = Process.GetCurrentProcess(); var otherProc = Process.GetProcessesByName(proc.ProcessName) .Where(v => v.Id != proc.Id) .FirstOrDefault(); if (otherProc != null) { IntPtr hWnd = otherProc.MainWindowHandle; if (IsIconic(hWnd)) { ShowWindowAsync(hWnd, SW_RESTORE); } SetForegroundWindow(hWnd); return; } }