I want to open a hidden Internet Explorer window without it stealing focus. I have a Timer object that opens Internet Explorer every 5 minutes to check a website for updates. The problem is every time it checks for updates, it steals focus from the current application in the foreground. Below is how I start the process:
Process m_Proc = new Process();
m_Proc.StartInfo.Arguments = String.Format("{0}{1}", "-nomerge ", browserURL);
m_Proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
m_Proc.StartInfo.UseShellExecute = true;
m_Proc.StartInfo.CreateNoWindow = true;
m_Proc.StartInfo.FileName = String.Format("iexplore.exe");
m_Proc.Start();
It always steals focus, even when it is hidden. I want it to start like nothing is happening, so users can continue to work on what they are doing. Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…