PDA

View Full Version : Enumerate



rhosk
11-19-2003, 08:05 AM
Alright guys, pulling my hair out here. Can someone show me an example of outputting "processes" or "titles" in a dialog.Message or some kind of output. Really appreciate it. This new scripting takes some getting used to, to say the least (although, I do love the additional power, don't get me wrong). I keep getting errors that it must be a string...concatenate...not a table, blah, blah. One example please? Thanks.

Brett
11-19-2003, 08:13 AM
Just because I love you (not like that... as a customer and friend):


tblProcesses = Window.EnumerateProcesses();
if(tblProcesses)then
strOutput = "";
for handle,path in tblProcesses do
strOutput = strOutput..handle.."="..path.."\r\n";
end
Dialog.Message("Output",strOutput);
end

Corey
11-19-2003, 08:20 AM
Alright guys, pulling my hair out here.

Be systematic, try to dither it. Leaves a natural look. Random hair pulling leads to tufting.


Just because I love you (not like that... as a customer and friend)

I believe that quote violates a Micket Gilley copyright. Pretty sure anyhow...

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

rhosk
11-19-2003, 08:29 AM
Alright Corey, how many times are you going to edit that? :D

Brett, that's great, thanks. This didn't solve my problem (wrong terminolgy or assumptions on my part). I want to find/locate all of the processes that are active in Task Manager and get their Window Titles. Window.Enumerate and ..Titles, only gives me active on my desktop, it seems. Is there a way I can grab this info (all processes)?

TJ_Tigger
11-19-2003, 08:37 AM
Great question Ron. I have asked that one before (http://www.indigorose.com/forums/showthread.php?s=&threadid=5587) and never recieved an answer.

Corey
11-19-2003, 08:43 AM
Seems to these old eyes I've seen you both edit a few posts. Feel free to correct me if I'm mistaken. :)

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

rhosk
11-19-2003, 08:49 AM
I don't think Tigg was asking that question Corey (or was he?, hmmm). Now I don't know what to think. You guys are freaking me out here.

Anyway, hope Brett is looking this one up :) I need to kill a process!!! Don't want to resort to building a separate app in Ver4.....now that would be unthinkable! But alas, I will do that if I have to. It might make the CD look ugly though. Not that both versions are not pretty.

I need a drink!!

Corey
11-19-2003, 08:55 AM
Har! :)

Well in Brett's example you have the handle in the variable strOutput right? Then you can just use that to kill the window, i.e. Window.Close(strOutput, CLOSEWND_SENDMESSAGE); right? Or am I missing something here?

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

Brett
11-19-2003, 08:58 AM
You are right in that the Window.EnumerateProcesses only returns results for processes that have window handles. I am going to look into this for you guys today and find some sort of solution even if that means making an action plugin to do it.

And rhosk, how did you use AMS40 to actually kill a process that didn't have a window handle attached to it? (Just so I can tranlate this over properly) Thanks!

rhosk
11-19-2003, 08:58 AM
I think you're missing something here. ----- This is for Corey, not you Brett. We posted at the same time.

These particular calls are only retrieving my Desktop Windows (that are open). I have 22 processes running and I want to find a specific title in these processes and kill it. You have to put your ver4 hat on sir. This was easily done in that version. I just can't seem to find what does it in this one :)

Yeah, I edited, so what ;):):):)

rhosk
11-19-2003, 09:17 AM
Originally posted by Brett
You are right in that the Window.EnumerateProcesses only returns results for processes that have window handles. I am going to look into this for you guys today and find some sort of solution even if that means making an action plugin to do it.

And rhosk, how did you use AMS40 to actually kill a process that didn't have a window handle attached to it? (Just so I can tranlate this over properly) Thanks!

Ye ol' -

%WndTitles% = Window.GetTitles
%Result% = Dialog.MessageBox ("Title", "%WndTitles%", Ok, Question)

http://rphmedia.net/test/window.jpg

Tis neat. Gives you every process running (exact titles) and then I merely gave it a "TerminateProcess" and poof, gone out of Task Manager. Had to do this for the mysterious Adobe processes - even after you're done viewing (and exiting) Adobe Readers. It worked quite well :)

Brett
11-19-2003, 09:21 AM
Thanks, Ron. We will have a solution for you in the next few days. I appreciate you taking the time to fully explain what you are trying to accomplish - that helps.

Corey
11-19-2003, 09:32 AM
In all the hustle and hub-bub, didn't even notice that feature had changed Ron. Thanks for the heads up. :)

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

rhosk
11-19-2003, 09:32 AM
Gotta love this (better than) "real-time" support. It's like we're talking on the freakin' phone!

Thanks guys, we need this!

Corey
11-19-2003, 09:38 AM
It's a safe bet no other busy lead programmers do that. I've been looking around, I think the support here is the best anywhere, especially lately with Brett's increased presence. If there's better out there I'd like to see it. I check around all the time too, Adobe forums, Macromedia, etc...

:cool:

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

TJ_Tigger
11-19-2003, 12:10 PM
Originally posted by Corey
In all the hustle and hub-bub, didn't even notice that feature had changed Ron. Thanks for the heads up. :)

I guess I need to get better with my explainations. That is what I was trying to get at. Argh. Must have been on of my unarticulate days at the keyboard, or I was running low on caffine.

Oh well, it will be good to have a solution. As I mentioned in my earlier thread, even if we had the option to specify whether or not the process had a window. I originally posted this question when working to kill an Adobe process (acrotray.exe) that did not have a window. This was raised because of an AMS4 problem involving killing that process.

It was here (http://www.indigorose.com/forums/showthread.php?s=&threadid=2440).

Ron is this the same thing but for AMS5?

rhosk
11-19-2003, 01:28 PM
Well, things have changed since my original post (partially because of an earlier warning you [coincidently] gave me about keystroke logging, thanks, have reconsidered that option). I just wanted to erraticate a program when exiting the app and not leave any fingerprints. But, I'm moving on to other (hopefull) solutions concerning unfocused "key press detection". You'd think it would be easy :)

Back to the subject, AMS4 did do it nicely though with TerminateProcess. That Adobe stuff was driving me crazy for a while, but managed to punch that out of the TM with no problems whatsoever. And if they can't come up with a solution soon, I guess I can just start a tiny AMS4 app to do the job. Ah, I think they'll prevail!

rhosk
11-20-2003, 01:39 PM
Thanks for the update guys!! Works great! :)

TJ_Tigger
11-21-2003, 01:48 PM
That works great guys.