Hey everyone, the name pretty much says it all, I need a more reliable code then AppActivate that does the same thing. I need it to activate a program I tell it to, perferribly without calling the process id. Thank you much in advance.
Printable View
Hey everyone, the name pretty much says it all, I need a more reliable code then AppActivate that does the same thing. I need it to activate a program I tell it to, perferribly without calling the process id. Thank you much in advance.
What problems are you having with AppActivate? Without knowing the issue you are having, how can we know what will help.
It does not always find the program i specified, it will return cannot find process 0. I use AppActivate("Notepad") or AppActivate("Untitled - Notepad") It will work ocassoinally and then randomly give that error. It doesn't matter which one i use.
Does AppActivate give you the error, or are you using the result in another call, which is giving you the error?
it is appactivate, it will ocassionally bring the window into focus but ocassionally it will give me that error.
Try something like this.
Now "notepad" in this case is the process name, not the value from the title bar.Code:For Each p As Process In Process.GetProcessesByName("notepad")
AppActivate(p.Id)
Next
Hmmmm, i am surprised that works, i am in a class for vb6 programming and have been using a for next loop and did not realize you could use this, I will continue to use it, :D Thank you much. Credit will be given to you in my final programs.