Solved

is possible to end a task in xp running by the user?

Posted on 2006-06-21
6
174 Views
Last Modified: 2010-08-05
i am creating an automatic downloader and installer but the problem is that the i need to to end the running process i want update.

the scenario is the following:

the specifi process runs everytime the user startup his computer and it has the same name as another process so the only difference is that this process is executed by the current logged on "User Name". if you run the "Task Manager" you see the process running by the "User Name"  and know what the process is.

now what i need to know is how to end this process identified by the current username.

is it clear?

B!
0
Comment
Question by:José Perez
  • 3
  • 2
6 Comments
 
LVL 29

Accepted Solution

by:
nffvrxqgrcfqvvc earned 125 total points
ID: 16955944
<< has the same name as another process

Very bad idea and not to strait forward. Many spyware applications do this and if you do this also then you run the potential of your program being deleted by many of the free software today. This includes Mcafee,Norton,Windows Defender,SpyBot. All of these programs and more will look up that process name and location in there databases. If the location isn't default then you have a pretty good chance that one of these programs will prompt the user that your process is a virus.

You should change your process name if you want your program to stay alive on a system.
0
 
LVL 2

Author Comment

by:José Perez
ID: 16960084
i made it myself!

now the explanation so i can share the solution.

what i did is to create a fill with the process id, every time the process starts it writes a file with the number of the process id, so to close it i get the handles for this process id and then send a shutdown to the process's handles.

B!
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 16960178
i assume you are ending your process using the PID, would you be using TerminateProcess API? You should first try to close your application the standard way which is to send a WM_CLOSE message.

anyways above comment was only indicating that if you have a process name that is the same name of a windows process then your process will most likely be detected as a virus.
0
 
LVL 2

Author Comment

by:José Perez
ID: 16960213
the "same name" comment is appreciated, i think i can give you some points for it, not all of them, do you think so?

B!
0
 
LVL 2

Author Comment

by:José Perez
ID: 17001786
Comment for moderator.

i would like to assign 60 points for egl1044 because the answer give me an idea to consider for future development and i found the solution by my self.

can it be done?

thanks,

matt.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question