コード例 #1
0
        private bool HideWindowIfNotForeground()
        {
            if (_mainWindowEntry?.IsForeground() ?? false)
            {
                return(false);
            }

#if (DEBUG)
            var foregroundWindow = WindowEntryFactory.Create(WindowToForeground.GetForegroundWindow());
            Log.DebugFormat("Window does not have focus when initialization is complete. Current foreground window is {0} (Process '{1}')", foregroundWindow.HWnd, foregroundWindow.ProcessName);
#endif

            Hide(false);
            return(true);
        }