[SOURCE] Suspender Process [TUT][LEECHED]

Posts 1–5 of 5 · Page 1 of 1
[SOURCE] Suspender Process [TUT][LEECHED]
Step one open your VS 2008 or VS 2010
create New Project and write name what you like
Create 1 Button and 1 textBox look like this pic

now on your project add Module paste this code
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
Now view code Form1 and paste this code
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

    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

    Dim ExeName As String = IO.Path.GetFileNameWithoutExtension(Application.ExecutablePath)
Now Finishing double klik on Button1 and paste this code
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
If u like this Press thanks for Me
Nice leech from **********.
thanks for sharing i guess

add credits
This Rule is enforced.

http://www.mpgh.net/forum/31-c-c/127...ng-policy.html


Moved to Tuts (5 hr redirect)
Title Changed to reflect leeched.
Infraction Given, That's first warning.
After that. Ban per Policy. Also, Next time you are on, add credits.

Thanks and Sorry




Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?