A1VBCode Forums

check if program is running and shows a prompt


http://www.a1vbcode.com/vbforums/Topic30051.aspx

By john_zakaria - 2/14/2011

hi everyone



now icheck if program is running or not using this code



Process[] pname = Process.GetProcessesByName("AIM");

if (pname.Length == 0)

MessageBox.Show("nothing");

else

MessageBox.Show("run")





all that i need is to be sure that the program is closed before taking my action and shows for the user that the program AIM is already running. you must close it before completing (OK,Cancel)



and after pressing ok i will put my fuction



for example:

when you install the photoshop and the program is already running it shows for you that the program is already running. you must close it before completing (OK,Cancel)





and after clicking OK .. the program will compltete instalation