Пример #1
0
        private static Process OpenAnalysisReportUntilWndValid(SolutionInfoViewModel currentSolution,
                                                               StartupConfigurationMode startupConfigurationMode, string selectedRunFolder, bool minimizeWindow)
        {
            Process devenvProc;

            if (!Prepare(currentSolution, startupConfigurationMode, selectedRunFolder, out devenvProc))
            {
                return(null);
            }

            IntPtr wndHandle;

            do
            {
                wndHandle = devenvProc.MainWindowHandle;
            } while (wndHandle == IntPtr.Zero);

            Unmanaged.ShowWindow(wndHandle,
                                 minimizeWindow ? Unmanaged.ShowOptions.Minimize : Unmanaged.ShowOptions.Show);

            return(devenvProc);
        }
Пример #2
0
        /// <summary>
        ///    Открывает diff-файл лога в формате PVS-Studio
        /// </summary>
        /// <param name="currentSolution">Решение</param>
        /// <param name="startupConfigurationMode">Конфигурация запуска</param>
        /// <param name="selectedRunFolder">Директория тестового запуска</param>
        private static void OpenAnalysisReportUntilWndValid(SolutionInfoViewModel currentSolution,
                                                            StartupConfigurationMode startupConfigurationMode, string selectedRunFolder)
        {
            Process devenvProc;

            if (!Prepare(currentSolution, startupConfigurationMode, selectedRunFolder, out devenvProc))
            {
                return;
            }

            // Блокируем поток, пока не появится окно
            var vsIsInVisibleState = false;

            do
            {
                var vsWndHandle = devenvProc.MainWindowHandle;
                if (vsWndHandle == IntPtr.Zero)
                {
                    continue;
                }

                vsIsInVisibleState = Unmanaged.IsWindowVisible(vsWndHandle);
            } while (!vsIsInVisibleState);
        }
Пример #3
0
        private static void TerminateParent(Process parentProcess)
        {
            string errorMessage;

            Unmanaged.TryTerminateProcess(parentProcess, out errorMessage);
        }