Solved

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

Posted on 2006-06-21
6
172 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now