Form1 にこのボタン クリック コードがあります。
private void DriverVerifier_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you Sure you want to Launch the Driver Verifier. Click Yes to Confirm and No to continue", "WinForm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
}
else
{
ProcessRun.Processing(Environment.SystemDirectory, "verifier.exe", "", false, "");
}
}
これにより、Windows 7 および 8 およびその他のバージョンに付属する Driver Verifier Manager プログラムが実行されます。
この問題は、ドライバー検証マネージャーがフォームの背後で実行されていて、それを前面に出すことができない場合に、一部のユーザーの一部の Windows バージョンで発生します。
私の質問は、このプロセスを前面に強制する方法があるかどうかです。
これは私のクラス ProcessRun のコードです:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.IO;
namespace Diagnostic_Tool_Blue_Screen
{
static class ProcessRun
{
public static void Processing(string WorkingDirectory, string FileName, string Arguments, bool StandardOutput, string OutputFileName)
{
Process proc = new Process();
proc.EnableRaisingEvents = true;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = StandardOutput;
proc.StartInfo.FileName = FileName;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.WorkingDirectory = WorkingDirectory;
proc.StartInfo.Arguments = Arguments;
proc.Start();
if (StandardOutput == true)
{
string output = proc.StandardOutput.ReadToEnd();
DumpOutput(WorkingDirectory + "\\" + OutputFileName, output);
}
proc.WaitForExit();
proc.Close();
}
private static void DumpOutput(string filename, string output)
{
StreamWriter w = new StreamWriter(filename);
w.Write(output);
w.Close();
}
}
}
これは、バックグラウンドでフォームの背後にあるときにプログラムがどのように見えるかのイメージです。
これは、問題を抱えているユーザーが問題を説明するために書いたものです。
ただし、Windows 8 と Windows 8.1 の両方を使用して、Seven でまだテストしていないバグが 1 つ見つかりました。Driver Verifier は、クリックして開くと (下部の赤/茶色のボタン)、ツールのメイン ウィンドウが拒否するため、まったく役に立ちません。フォーカスを維持したまま、移動、最小化、または閉じることで、Driver Verifier ウィンドウがツール ウィンドウの下にあるため表示されなくなります (スクリーンショットを参照)。
これは、Driver Verifier を脇に移動して完全に表示できるため、大きなディスプレイや複数のディスプレイ システムでは小さな問題ですが、小さな単一のディスプレイ システムでは、このツールの Driver Verifier 全体が役に立たなくなります。