Link to home
Start Free TrialLog in
Avatar of SonicM3
SonicM3

asked on

How do I import from task manager into my delphi application

I want to be able to import the image name, memory and discription from the process manager into my delphi application.
I was wondering if someone could provide a snippey as I am way behind and starting to panic.
This needs to work on xp and vista
ASKER CERTIFIED SOLUTION
Avatar of ccupo
ccupo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SonicM3
SonicM3

ASKER

thanks man, but anyway how instead of the taskmanager opening a big box, canit go into a memo with a scroller?

and if possible, when you highlight and click the one you want , it displays into a edit.text ?
Avatar of SonicM3

ASKER

so its gota be like this..


data from proccess manager INCLUDING file descriot ( this is a must ).. in a nice memo with scroller. So when you scroll down and see a file description aswell as the name.. as soon as you click the name, it goes into a edit.text..

then i can do the rest mate.
Avatar of SonicM3

ASKER

so its gota be like this..


data from proccess manager INCLUDING file description ( this is a must ).. in a nice memo with scroller. So when you scroll down and see a file description aswell as the name.. as soon as you click the name, it goes into a edit.text..

then i can do the rest mate.

sorry i didnt spell description correct, i type too fast.
Avatar of SonicM3

ASKER

come on lads , just s above. cheers.  kinda important the data is phased inline.
Avatar of Geert G
what do you mean with file description ?
ccupo allready gave you the filename
 s:=s+UpperCase(ExtractFileName(FProcessEntry32.szExeFile))+#13;

what is this for ?
Avatar of SonicM3

ASKER

if you CTRL+ALT+DEL then ull see imagename, username, cpu, memory and file description. Ive seen it done on another delphi app, but no source. Im not intrested in the rest, i just want the imagename which is the process name and also the file description to be listed.

in the way above.
Avatar of SonicM3

ASKER

i found this link that has full source. But i tried it and works great, however its too complex for what i need from it is the process part, including the descripton.

http://clk.about.com/?zi=18/1Pp&sdn=delphi&cdn=compute&tm=62&gps=142_45_1263_777&f=11&su=p284.9.336.ip_p504.1.336.ip_&tt=2&bt=1&bts=0&st=31&zu=http%3A//clk.about.com/%3Fzi%3D18/1Pp%26sdn%3Ddelphi%26cdn%3Dcompute%26tm%3D26%26gps%3D184_42_1263_777%26f%3D11%26su%3Dp284.9.336.ip_p504.1.336.ip_%26tt%3D2%26bt%3D1%26bts%3D0%26st%3D31%26zu%3Dhttp%253A//delphi.about.com/library/code/fdac_task_manager_src.zip

can someone have a look at it?

it is neat and tidy, all i want it process manager clone of the proccess's, imagename and deacription, exactly as in process manager when you CTRL+alt_del
Avatar of SonicM3

ASKER

Ok i got it working all in list box and pharsed.

However, can someone fix my code please. at the moment it collects info from the process manager and puts it into a neat listbox. However, i dont just need the names i MUST have the description too. ( if you press ctrl+alt+del ull see under process "description" )

My code highlights the text too, and but it needs to be put into a edit.text as soon as you click on one of the process's.

Please someone help me with this.

here is the code.

( uses TLHelp32,)

((please dont correct my code withought helping me with the above ))


 procedure TForm1.Button1Click(Sender: TObject);
var
MyHandle: THandle;
Struct: TProcessEntry32;
begin
try
MyHandle:=CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
Struct.dwSize:=Sizeof(TProcessEntry32);
if Process32First(MyHandle, Struct) then
ListBox1.Items.Add(Struct.szExeFile);
while Process32Next(MyHandle, Struct) do
ListBox1.Items.Add(Struct.szExeFile);
except on exception do
ShowMessage('Error showing process list');
end
end;

Open in new window

what is this for ?
Avatar of SonicM3

ASKER

it doesnt matter what its for, its for a school project that deals with this sort of thing.
a school project where you need to kill a exe ?
that doesn't sound like a project
Avatar of SonicM3

ASKER

DOES IT ACTUALLY MATTER? are you going to argue or help, youve been usless.

Can someone help me please, yes it is a school project, im not going to give the exact details as ill be changing the code anyway.

UPDATE:

I have it all working, i just need someone to put the code in where it shows in my task manager "description" also.

Avatar of SonicM3

ASKER

Omg, it doesnt matter what its for, this isnt a forum, i pay for help. I cant believe your argiung with me about my own private project.

anyway, if someone can help me out lads, would be great.
it does matter. and i have my doubts about your "private" project

let me put it down as to what this looks like:

you want to get a list of programs running
you want to kill a specific one
you want to run the program with admin rights so nobody sees you killed it

why ?
maybe you want to stop a program run by the school itself, which does some monitoring
this site is not intended for behaviour like this
even if you are paying for it !

so either you come up with a good explanation or help will stop.
Avatar of SonicM3

ASKER

the program is a removal tool for a remote admin tool, i need to find the file version so the user can select the correct one to kill at process before deleting it inside the hidden location.
The idea is to create a removal tool for a remote admin tool that the school created that only funtion is to say hi still infectect on startup, my job is to make a removal tool to disinfect reg keys the lot, i have done all this just need this final step.
the asker is a person working on his "so called school project"

the question the asker is asking all lead to the following conclusion
he wants to kill a program (probably run by the school)
he wants to use admin rights
he wants to run his own program

this is what looks like replacing a running program with his own "virus" program

besides that, he does not want to give any info on the school project
and there are not other questions about this school project
there normally would be as the asker has toruble with even the simplest beginner code
Avatar of SonicM3

ASKER

you think because i want to pull in the description its a virus, lol.
I already have the code to locate and find every process that is not what the project is about, i am looking to kill a file in the process called findme.exe and the details are called tast4 complete.
I can kill the file fine but it must match the description or task4 wont be completed.
what is the problem, why are you playing detective if your unable to answer  the question just say so.

i am not arguing here, i am trying hard to fix the problem and all you can do is pick fun at me?
sorry but there is no wild and wacky conspiracy.
i will no longer answer because i find all these questions very suspicious
i can't imagine why some staff member would want a removal tool for a remote admin
quite the opposite actually, they wouldn't want it removed

this just doesn't feel right.

This is my last word on it.

Unsubscribed.
Avatar of SonicM3

ASKER

have you even read your answer?

You wondering why I am making a removal tool for a remote admin tool (rat)
lol, maybe you should ask that same question to every single anti virus software company.
Its what it says a REMOVAL TOOL to rid a computer of a trojan horse (rat).
This is my project, what on earth are you talking about. you cant answer because you dont know, every question i have asked you have been there like a bad smell, never offering an answer.
What kind of person questions everything i am doing, I have explained to you like I was talking to my little borther to make it easy to understand.
I wont show you any respect if thats what your after sitting behind your "wait for others to asnwer then jump in at the last moment to steal points score level" because you dont deserve respect the way you have handled this question.
You need to remember who you are.
Why is it so hard to you to understand what I need, its a removal tool and you "cant amagine why someone would want this for a remote admin tool, they wouldnt want to remove it" that just sums you up dude.
if you wont help because you cant understand the question just say so, otherwise stop hassling me and answer the question, its simple all i am asking is to get the file description from the process and you are crying about it.
Dont bother to give me an answer i will wait for another user.

you sir are an idiot!
@SonicM3,
Let me step in for a second and see if I can convey the reasoning behind the your failure to get what you consider to be reasonable answers:
  1. You have been a bit stirdent in your demand for a solution.
  2. Beert has a point in that it does matter why you want to be able to do this.  It is not unreasonable for those of us you know how to do this sort of thing to be leary of someone who seems to be something of a novice and, yet, who wants to learn how to do the sort of things that malicious applications do.  So, Geert has only acted in the same manner that most of us would have in order to keep from giving someone the means for writing, admittedly crudely sructured, malware.
  3. Your refusal to provide any reason for wanting to be able to perform the sorts of things you are asking aboout only serves to heighten suspicions, in spite of you rude responses regarding the question being asked.
  4. If this is, indeed, for a class project, then IMHO (and, I have reason to believe, Geert's as well), you bloody well need to do this yourself . . . I know that neither Geert nor I will be receiving any credits for the course you are asking us to help you pass by helping writing code for you.
  5. You are correct, you are NOT paying anyone for this requested assistance but what you do not seem to realize is that, BECAUSE you are not paying for it, a) you cannot demand it and b) you may have to justify receiving it.
  6. As for your respect, frankly I have no reason to believe that Geert or any others of us will lose sleep at night over your not respecting us.  
  7. Insulting those who might offer assistance is not a functional approach to receiving assistance . . . if you do not wish to interact with someone, just don't respond!
  8. Since you are not a company prodcing an antivirus application, why is it that you wonder why someone might be concerned about the welfare of the community at large if some anonymous ametuer programmer starts creating an app that can nuke things?  Those of us who are professional developers tend to have this thing called a conscience that leads us to be aware of the power of certain activities and the danger that can come from their being handed over to those who do not have sufficient experience to realize the implications of that power.  (And, yes, I am saying that you are inexperienced and therefore likely to do something stupid with this app . . . in the same vein that I wouldn't let your average 12 year old drive an 18-wheeler r play with automatic weapons. ;-)
  9. Finaly, you have gained a place in the list of those to whom I never expect Geert to respond and those to whom I seriously doubt any other will respond or take seriously . . . including myself.
Have a good day and I would suggest you acquire some good reading materia related to Delphi and Pascal and that you learn how to search the internet for assistance.  
Avatar of SonicM3

ASKER

not reading that, sorry..

anyone any help on the subject pls?
Avatar of SonicM3

ASKER

solved it myself, as these couldnt.
Avatar of SonicM3

ASKER

he never wasted by time, genuine guy.