Hello,
i will show u how to make a simple Suspender in Visual Basic 2010.
What we need :
Visual Basic 2008/2010 or Visual Studio 2008/2010.
Brain.exe
Step one:
Open Visual Basic and create a new Project, Windows Forms and call it how u want.
Step two:
We create 1 Button and 1 TextBox. We call the Button "Suspend".
Then we make a right click on our Project and go on Add and click on Module.
Step three:
In Module.vb we gonna declare all functions to Suspend and to Resume a Process that our Programm can Suspend or Resume a Process.
Step four:
Then we go back to our Form1 and press right click on it and press "View Code". Here we declare the SuspendProcess and ResumeProcess function in Private Sub.
SuspendProcess function:
ResumeProcess function:
Now we go back to our Form and double click on our Button.
Then we write the function that will suspend and resume our Process from the TextBox.
When you press on Suspend the Button will get the name Resume and when you press Resume the Button will get the name Suspend again.
In the TextBox you write your Process name but without .exe in the end !
I forgot something: Double click on your Form and type in
That code make that the process get suspended with full rights. If you donīt have this code then Game Processes wouldnīt get suspended and resumed only the windows Processes.
If you want to get the current Process List and suspend it from the List box then you make this =>
We add a ListBox and a new Button(we call the Button also "Suspend") and double click on our Form and write the function that will get our current Process List:
Then we go back to our Form and double click on the new Button that we added. Then we write the same code as for the TextBox only with ListBox:
Now we are finished and so we can Debug our Programm =)
In the end you can design your Programm how you want if you want ;)
I hope i explained it to you well and you understood everything well =)
~Have Fun~
i will show u how to make a simple Suspender in Visual Basic 2010.
What we need :
Visual Basic 2008/2010 or Visual Studio 2008/2010.
Brain.exe
Step one:
Open Visual Basic and create a new Project, Windows Forms and call it how u want.
Step two:
We create 1 Button and 1 TextBox. We call the Button "Suspend".
Then we make a right click on our Project and go on Add and click on Module.
Step three:
In Module.vb we gonna declare all functions to Suspend and to Resume a Process that our Programm can Suspend or Resume a Process.
PHP Code:
Public Enum ThreadAccess As Integer
TERMINATE = (&H1)
SUSPEND_RESUME = (&H2)
GET_CONTEXT = (&H8)
SET_CONTEXT = (&H10)
SET_INFORMATION = (&H20)
QUERY_INFORMATION = (&H40)
SET_THREAD_TOKEN = (&H80)
IMPERSONATE = (&H100)
DIRECT_IMPERSONATION = (&H200)
End Enum
Public Declare Function OpenThread Lib "kernel32.dll" (ByVal dwDesiredAccess As ThreadAccess, ByVal bInheritHandle As Boolean, ByVal dwThreadId As UInteger) As IntPtr
Public Declare Function SuspendThread Lib "kernel32.dll" (ByVal hThread As IntPtr) As UInteger
Public Declare Function ResumeThread Lib "kernel32.dll" (ByVal hThread As IntPtr) As UInteger
Public Declare Function CloseHandle Lib "kernel32.dll" (ByVal hHandle As IntPtr) As Boolean
Step four:
Then we go back to our Form1 and press right click on it and press "View Code". Here we declare the SuspendProcess and ResumeProcess function in Private Sub.
SuspendProcess function:
PHP Code:
Private Sub SuspendProcess(ByVal process As System.Diagnostics.Process)
For Each t As ProcessThread In process.Threads
Dim th As IntPtr
th = OpenThread(ThreadAccess.SUSPEND_RESUME, False, t.Id)
If th <> IntPtr.Zero Then
SuspendThread(th)
CloseHandle(th)
End If
Next
End Sub
PHP Code:
Private Sub ResumeProcess(ByVal process As System.Diagnostics.Process)
For Each t As ProcessThread In process.Threads
Dim th As IntPtr
th = OpenThread(ThreadAccess.SUSPEND_RESUME, False, t.Id)
If th <> IntPtr.Zero Then
ResumeThread(th)
CloseHandle(th)
End If
Next
End Sub
Then we write the function that will suspend and resume our Process from the TextBox.
PHP Code:
Dim game As Process() = Process.GetProcessesByName(TextBox1.Text)
If Button1.Text = "Suspend" Then
SuspendProcess(game(0))
Button1.Text = "Resume"
Else
ResumeProcess(game(0))
Button1.Text = "Suspend"
End If
In the TextBox you write your Process name but without .exe in the end !
I forgot something: Double click on your Form and type in
PHP Code:
Process.EnterDebugMode()
That code make that the process get suspended with full rights. If you donīt have this code then Game Processes wouldnīt get suspended and resumed only the windows Processes.
If you want to get the current Process List and suspend it from the List box then you make this =>
We add a ListBox and a new Button(we call the Button also "Suspend") and double click on our Form and write the function that will get our current Process List:
PHP Code:
Dim Processe As Process
For Each Processe In Process.GetProcesses
ListBox1.Items.Add(Processe.ProcessName)
Next
PHP Code:
Dim game As Process() = Process.GetProcessesByName(ListBox1.Text)
If Button1.Text = "Suspend" Then
SuspendProcess(game(0))
Button1.Text = "Resume"
Else
ResumeProcess(game(0))
Button1.Text = "Suspend"
End If
In the end you can design your Programm how you want if you want ;)
I hope i explained it to you well and you understood everything well =)
~Have Fun~