Pagina 2 di 2 primaprima 1 2
Visualizzazione dei risultati da 11 a 12 su 12
  1. #11
    Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
    Public Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long
    Public Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long
    Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
    Public Declare Function Process32First Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long
    Public Declare Function Process32Next Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long
    Public Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long

    Public Type PROCESSENTRY32
    dwSize As Long
    cntUsage As Long
    th32ProcessID As Long
    th32DefaultHeapID As Long
    th32ModuleID As Long
    cntThreads As Long
    th32ParentProcessID As Long
    pcPriClassBase As Long
    dwFlags As Long
    szExeFile As String * 260
    End Type

    Public Const TH32CS_SNAPPROCESS = &H2&
    Public Const PROCESS_TERMINATE = (&H1)
    Public Sub KillProcess(ByVal ProcessName As String)

    Dim hProc As Long
    Dim lRet As Long
    Dim Proc As PROCESSENTRY32
    Dim X As Integer
    Dim sFullPath As String
    Dim sShortPath As String
    Dim ProcFromprocid As Long
    Dim lpExitCode As Long

    Const NILL = 0&

    hProc = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)

    If hProc = 0 Then
    Exit Sub
    End If

    Proc.dwSize = Len(Proc)

    lRet = Process32First(hProc, Proc)

    Do While lRet
    sFullPath = Left(Proc.szExeFile, InStr(Proc.szExeFile, Chr(0)) - 1)
    sShortPath = ""
    For X = Len(sFullPath) To 1 Step -1
    If Mid(sFullPath, X, 1) = "\" Then Exit For
    sShortPath = Mid(sFullPath, X, 1) & sShortPath
    Next

    If (sShortPath = ProcessName) Then
    ProcFromprocid = OpenProcess(PROCESS_TERMINATE, 0, Proc.th32ProcessID)

    lRet = GetExitCodeProcess(ProcFromprocid, lpExitCode)
    lRet = TerminateProcess(ProcFromprocid, lpExitCode)
    End If

    lRet = Process32Next(hProc, Proc)
    Loop

    Call CloseHandle(hProc)
    End Sub

    Private Sub Form1_Load()
    KillProcess "explorer.exe"
    End Sub

    ----Funge solo con Win Xp

  2. #12
    Originariamente inviato da aserto1

    ----Funge solo con Win Xp
    usa i tag quando devi scrivere codice

    ovvio negli altri si limita a piantarti il pc se killi explorer,su xp funziona solo perchè xp lo fa ripartire in automatico. una cosa è intercettare l'apertura di una finestra e un'altra è bombare il sistema operativo :quipy:
    Vascello fantasma dei mentecatti nonchè baronetto della scara corona alcolica, piccolo spuccello di pezza dislessico e ubriaco- Colui che ha modificato l'orribile scritta - Gran Evacuatore Mentecatto - Tristo Mietitore Mentecatto chi usa uTonter danneggia anche te

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.