Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[HELP VB2008] Stop an Application

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
OSIRIS
Grandmaster Cheater
Reputation: 0

Joined: 27 Aug 2006
Posts: 654

PostPosted: Wed Mar 12, 2008 3:01 pm    Post subject: [HELP VB2008] Stop an Application Reply with quote

So so I goggled a code on how to kill a process. I got this

Code:

Dim pList() As System.Diagnostics.Process = _
    System.Diagnostics.Process.GetProcessesByName("notepad")
For Each proc As System.Diagnostics.Process In pList
    Dim resp As MsgBoxResult
    resp = MsgBox("Terminate " & proc.ProcessName & "?", _
        MsgBoxStyle.YesNo, "Terminate?")
    If resp = MsgBoxResult.Yes Then
        proc.Kill()
    End If
Next


I understand this code completly it just closed notepad, but what if I didnt want a message box to appear? I just want the process to end immediately. I tried to modify the code to take out the message box but it was to hard. So if someone could please help me Sad

Also I know the past few days I have been asking like 20 questions a day and posting usless crap, but im just learning this language and soon I will be able to help you guys out Very Happy
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Mar 12, 2008 3:05 pm    Post subject: Reply with quote

Code:
Dim pList() As System.Diagnostics.Process = _
    System.Diagnostics.Process.GetProcessesByName("notepad")
For Each proc As System.Diagnostics.Process In pList
        proc.Kill()
Next


Wasn't really that hard.. I even did it in notepad.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
OSIRIS
Grandmaster Cheater
Reputation: 0

Joined: 27 Aug 2006
Posts: 654

PostPosted: Wed Mar 12, 2008 3:08 pm    Post subject: Reply with quote

Wiccaan wrote:
Code:
Dim pList() As System.Diagnostics.Process = _
    System.Diagnostics.Process.GetProcessesByName("notepad")
For Each proc As System.Diagnostics.Process In pList
        proc.Kill()
Next


Wasn't really that hard.. I even did it in notepad.


ty
+rep
Back to top
View user's profile Send private message
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Wed Mar 12, 2008 3:39 pm    Post subject: Reply with quote

I know he answered it but you just had to take out the For function.

In the beggining you're stating what you want to kill, and proc.kill actually "kills it".

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Mar 12, 2008 7:43 pm    Post subject: Reply with quote

AndrewMan wrote:
I know he answered it but you just had to take out the For function.

In the beggining you're stating what you want to kill, and proc.kill actually "kills it".


Wha? The loop is still intact.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Thu Mar 13, 2008 4:03 pm    Post subject: Reply with quote

AndrewMan wrote:
I know he answered it but you just had to take out the For function.

In the beggining you're stating what you want to kill, and proc.kill actually "kills it".


All I removed is the Msgbox check:

Code:
    Dim resp As MsgBoxResult
    resp = MsgBox("Terminate " & proc.ProcessName & "?", _
        MsgBoxStyle.YesNo, "Terminate?")
    If resp = MsgBoxResult.Yes Then
        // Keep The Kill Code That Was Here..
    End If


The loop is still there, the object was told to only add any proc that matched "notepad.exe" to the other, so the loop will kill all the notepad windows. There are more methods to be taken if you want to kill as specific Notepad window, but that was not the intended purpose.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Fri Mar 14, 2008 7:47 pm    Post subject: Reply with quote

taskkill.exe in your system32 folder is also fun to use too, and im not sure about the advantage of it
_________________
Get kidnapped often.
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Fri Mar 14, 2008 9:08 pm    Post subject: Reply with quote

blland wrote:
taskkill.exe in your system32 folder is also fun to use too, and im not sure about the advantage of it


I'm pretty sure he's talking programatticaly

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites