Guest Posted October 17, 2006 at 09:37 PM Report #58202 Posted October 17, 2006 at 09:37 PM Keria saber komo tar um processo! já tá aki um no forum mas é para outra versão digam ai plz!
Guest Posted October 18, 2006 at 05:56 PM Report #58379 Posted October 18, 2006 at 05:56 PM encontrei isto: dá um erro no notepad no final Option Explicit Private Type LUID lowpart As Long highpart As Long End Type Private Type TOKEN_PRIVILEGES PrivilegeCount As Long LuidUDT As LUID Attributes As Long End Type Const TOKEN_ADJUST_PRIVILEGES = &H20 Const TOKEN_QUERY = &H8 Const SE_PRIVILEGE_ENABLED = &H2 Const PROCESS_ALL_ACCESS = &H1F0FFF Private Declare Function GetVersion _ Lib "kernel32" () As Long Private Declare Function GetCurrentProcess _ Lib "kernel32" () As Long Private Declare Function CloseHandle _ Lib "kernel32" (ByVal hObject As Long) As Long Private Declare Function OpenProcessToken _ Lib "advapi32" (ByVal ProcessHandle As Long, _ ByVal DesiredAccess As Long, _ TokenHandle As Long) As Long Private Declare Function LookupPrivilegeValue _ Lib "advapi32" Alias "LookupPrivilegeValueA" _ (ByVal lpSystemName As String, _ ByVal lpName As String, _ lpLuid As LUID) As Long Private Declare Function AdjustTokenPrivileges _ Lib "advapi32" (ByVal TokenHandle As Long, _ ByVal DisableAllPrivileges As Long, _ NewState As TOKEN_PRIVILEGES, _ ByVal BufferLength As Long, _ PreviousState As Any, ReturnLength As Any) As Long Private Declare Function OpenProcess _ Lib "kernel32" (ByVal dwDesiredAccess As Long, _ ByVal bInheritHandle As Long, _ ByVal dwProcessId As Long) As Long Private Declare Function TerminateProcess _ Lib "kernel32" (ByVal hProcess As Long, _ ByVal uExitCode As Long) As Long 'Terminate any application and return an exit code to Windows. Public Function KillProcess(ByVal hProcessID As Long, Optional ByVal ExitCode As Long) As Boolean Dim hToken As Long Dim hProcess As Long Dim tp As TOKEN_PRIVILEGES If GetVersion() >= 0 Then If OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES Or TOKEN_QUERY, hToken) = 0 Then GoTo CleanUp End If If LookupPrivilegeValue("", "SeDebugPrivilege", tp.LuidUDT) = 0 Then GoTo CleanUp End If tp.PrivilegeCount = 1 tp.Attributes = SE_PRIVILEGE_ENABLED If AdjustTokenPrivileges(hToken, False, tp, 0, ByVal 0&, ByVal 0&) = 0 Then GoTo CleanUp End If End If hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, hProcessID) If hProcess Then KillProcess = (TerminateProcess(hProcess, ExitCode) <> 0) ' close the process handle CloseHandle hProcess End If If GetVersion() >= 0 Then ' under NT restore original privileges tp.Attributes = 0 AdjustTokenPrivileges hToken, False, tp, 0, ByVal 0&, ByVal 0& CleanUp: If hToken Then CloseHandle hToken End If End Function 'End module code ---------------------------- 'Example on how to use the code Dim pID As Long pID = Shell("Notepad.Exe", vbNormalFocus) '... If KillProcess(pID, 0) Then MsgBox "Notepad was terminated" End If
Hipnoted Posted October 18, 2006 at 06:00 PM Report #58380 Posted October 18, 2006 at 06:00 PM Yahoo usa o GeSHi para pores o código... "Nunca discutas com um idiota. Eles arrastam-te até ao seu nível e depois ganham-te em experiência"
Guest Posted October 18, 2006 at 06:01 PM Report #58382 Posted October 18, 2006 at 06:01 PM na sei o k é ! sou novato! explica
Hipnoted Posted October 18, 2006 at 06:03 PM Report #58383 Posted October 18, 2006 at 06:03 PM na sei o k é ! sou novato! explica Vês encima onde diz GeSHi? Clicas lá e escolhes a linguagem do teu código. Depois é só meteres o código entre aquelas tags que aparecem. 😛 "Nunca discutas com um idiota. Eles arrastam-te até ao seu nível e depois ganham-te em experiência"
Guest Posted October 18, 2006 at 06:08 PM Report #58386 Posted October 18, 2006 at 06:08 PM OND??????
Hipnoted Posted October 18, 2006 at 06:10 PM Report #58388 Posted October 18, 2006 at 06:10 PM Tens PM. "Nunca discutas com um idiota. Eles arrastam-te até ao seu nível e depois ganham-te em experiência"
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now