I am trying to use the Process class to launch a program, and it is working fine, except I cannot hide the window. I'm guessing it's because it's a command line program, but I don't like a blank black cmd window popping up for a second while the external program is doing its work. I am using the following code:
VB Code:
Process snmp = new Process() ProcessStartInfo psi = new ProcessStartInfo() psi.FileName = "snmpwalk.exe" psi.Arguments = txtQuery.Text psi.UseShellExecute = false psi.RedirectStandardOutput = true psi.WindowStyle = ProcessWindowStyle.Hidden snmp.StartInfo = psi snmp.Start() this.BringToFront() 'thought this would bring my app in front of the window, but nope! snmp.WaitForExit(500) txtResult.Text = txtResult.Text + snmp.StandardOutput.ReadToEnd()
Anyone have any ideas about how I can hide the window?


Reply With Quote
