Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start an invisible process in vb.net?

Tags:

vb.net

Is it possible to use system.diagnostics.process.start("Process.exe") But the process would not be seen by the user? For example, I want to play an audio in the background using windows media player, the audio will play but wmp won't be visible. Is it possible?

like image 690
user225269 Avatar asked Jan 12 '10 10:01

user225269


People also ask

How do you make a form invisible in VB net?

To hide a form it is necessary to call the Hide() method of the form to be hidden. Using our example, we will wire up the button on the subForm to close the form. Click on the tab for the second form (the subForm) in your design and double click on the button control to display the Click event procedure.

How do I start a process in VB net?

Start another application using your . NET code As a . NET method, Start has a series of overloads, which are different sets of parameters that determine exactly what the method does. The overloads let you specify just about any set of parameters that you might want to pass to another process when it starts.

What is process start?

Start(ProcessStartInfo) Starts the process resource that is specified by the parameter containing process start information (for example, the file name of the process to start) and associates the resource with a new Process component.


1 Answers

Try this:

Dim startInfo As New ProcessStartInfo("mplayer2.exe")
startInfo.WindowStyle = ProcessWindowStyle.Hidden

Process.Start(startInfo)

ProcessWindowStyle.Hidden:

The hidden window style. A window can be either visible or hidden. The system displays a hidden window by not drawing it. If a window is hidden, it is effectively disabled. A hidden window can process messages from the system or from other windows, but it cannot process input from the user or display output. Frequently, an application may keep a new window hidden while it customizes the window's appearance, and then make the window style Normal.

like image 179
Yannick Motton Avatar answered Sep 21 '22 22:09

Yannick Motton