Newbie Dealing with .exe files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi: I am writing a program to make changes to the texture files of a game.
It is important that the game not be running while the changes are made.

Is there a way in VB.net to determine if a program "XYZ.exe" is currently
running?

Also, is there a way from within the code to cause a program, "ABC.exe" to
start running?

thanx.....joisey
 
Joisey,

I give always nice links where it is proper done and than people give
solutions wich has the same effect as this one however not so simple, so now
I show this very simple one again.
\\\
Private mut As New Threading.Mutex(True, "myProgram", mutCreated)
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
If Not mutCreated Then Me.Close()
'etc
End Sub
///
Problem with this one and a lot of others samples given in this newsgroup,
is that when there is another program with exactly the same name as your
program, that will not run as well.

However this one is really very simple and I hope this helps?

Cor
 
Hi,

To see if the game is running take a look at
process.getprocessbyname

http://msdn.microsoft.com/library/d...osticsprocessclassgetprocessesbynametopic.asp

Ken
------------------
Hi: I am writing a program to make changes to the texture files of a game.
It is important that the game not be running while the changes are made.

Is there a way in VB.net to determine if a program "XYZ.exe" is currently
running?

Also, is there a way from within the code to cause a program, "ABC.exe" to
start running?

thanx.....joisey
 
Cor Ligthert said:
I give always nice links where it is proper done and than people give
solutions wich has the same effect as this one however not so simple, so
now I show this very simple one again.
\\\
Private mut As New Threading.Mutex(True, "myProgram", mutCreated)
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
If Not mutCreated Then Me.Close()
'etc
End Sub
///

Mhm... In this particular case I think the OP wants to check if a certain
(other) application is running. The mutex approach will only work if you
have control over the app's implementation.
 
Herfried,

After that I saw the message from Ken, I think that it is both and Ken
corrected that already.

Cor
 
Thanx
this looks like what I need.
I will bookmark the msdn library for future use
......joisey
 
Back
Top