Question Process closed help

ofek149

Member
Joined
Sep 8, 2012
Messages
7
Programming Experience
3-5
hi all
i need some help with code...
i want to build a program..
in the program i press on the button and then some files open..
is the code:


VB.NET:
        Dim File As String = "ConnectGame.exe"
        If My.Computer.FileSystem.FileExists(File) Then
            Dim p As Process = Process.Start(File)
        Else
            MsgBox("GameServer.txt not found!", MsgBoxStyle.OkOnly, "GameServer.txt Error")
        End If

now, what i want to do is
when the file "ConnectGame.exe" closed
the program run the same file again..


and 1 more question..
when the program run the "file"
i want to file be hide..
i mean the user dont see the program in the taskbar..
he can only see the program on Task Manager


ty for all helpers :)
good day..
 
Your Process object has an Exited event that you can handle to be notified when the process exits. You can stick with the local variable and use AddHandler or you can declare a member variable WithEvents and use a Handles clause on your event handler, as you would usually do with controls, etc.
 
Back
Top