|
-
Oct 28th, 2009, 08:33 PM
#1
Thread Starter
Junior Member
Alternative AppActivate Code
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.
-
Oct 28th, 2009, 09:07 PM
#2
Re: Alternative AppActivate Code
What problems are you having with AppActivate? Without knowing the issue you are having, how can we know what will help.
-
Oct 28th, 2009, 09:27 PM
#3
Thread Starter
Junior Member
Re: Alternative AppActivate Code
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.
-
Oct 28th, 2009, 09:29 PM
#4
Re: Alternative AppActivate Code
Does AppActivate give you the error, or are you using the result in another call, which is giving you the error?
-
Oct 28th, 2009, 09:33 PM
#5
Thread Starter
Junior Member
Re: Alternative AppActivate Code
it is appactivate, it will ocassionally bring the window into focus but ocassionally it will give me that error.
-
Oct 28th, 2009, 09:36 PM
#6
Re: Alternative AppActivate Code
Try something like this.
Code:
For Each p As Process In Process.GetProcessesByName("notepad")
AppActivate(p.Id)
Next
Now "notepad" in this case is the process name, not the value from the title bar.
-
Oct 28th, 2009, 09:49 PM
#7
Thread Starter
Junior Member
Re: Alternative AppActivate Code
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, Thank you much. Credit will be given to you in my final programs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|