차이점이 뭔가요?...
동생몬
Attribute VB_Name = ModuleProcessKill
Option Explicit
Private Declare Function TerminateProcess Lib kernel32 (ByVal ApphProcess As Long, ByVal uExitCode As Long) As Long
Private Declare Function OpenProcess Lib kernel32 (ByVal dwDesiredAccess As Long, ByVal blnheritHandle As Long, ByVal dwAppProcessId As Long) As Long
Private Declare Function ProcessFirst Lib kernel32 Alias Process32First (ByVal hSnapshot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function ProcessNext Lib kernel32 Alias Process32Next (ByVal hSnapshot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function CreateToolhelpSnapshot Lib kernel32 Alias CreateToolhelp32Snapshot (ByVal lFlags As Long, lProcessID As Long) As Long
Private Declare Function CloseHandle Lib kernel32 (ByVal hObject As Long) As Long
Private Const MAX_PATH& = 260
Private Const PROCESS_ALL_ACCESS = (&HF0000 Or &H100000 Or &HFFF Or &H1F0FFF)
Private Const TH32CS_SNAPPROCESS As Long = &H2
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 * MAX_PATH
End Type
Public Sub ProcKill(ProcName As String)
Dim uProcess As PROCESSENTRY32, rProcessFound As Long, hSnapshot As Long, szExename As String, i As Integer, myProcess As Long, exitCode As Long, AppKill As Boolean
uProcess.dwSize = Len(uProcess)
hSnapshot = CreateToolhelpSnapshot(TH32CS_SNAPPROCESS, 0&)
rProcessFound = ProcessFirst(hSnapshot, uProcess)
Do While rProcessFound
i = InStr(1, uProcess.szexeFile, Chr(0))
szExename = LCase$(Left$(uProcess.szexeFile, i - 1))
If LCase$(Right$(ProcName, Len(szExename))) = szExename Then
myProcess = OpenProcess(PROCESS_ALL_ACCESS, False, uProcess.th32ProcessID)
AppKill = TerminateProcess(myProcess, exitCode)
Call CloseHandle(myProcess)
End If
rProcessFound = ProcessNext(hSnapshot, uProcess)
Loop
Call CloseHandle(hSnapshot)
End Sub
사용할땐
ProcKill cmd.exe위 소스랑
Private sub timer1_timer()
shell tskill cmd,vbhide
end sub
위소스랑 뭐가 다른가요?
그리고 맨위 소스 사용법좀요 ..ㅠ
-
나봄
아래껀 tskill 이라는 프로그램이 없으면 실행이 안됩니다.
-
맞손질
저도 모르겠지만
예상하기에는
위에껀 API로 구현해서 프로세스를 잡는 것 같고.
밑에껀 tskill 이란 프로그램으로 해당 프로세스를 죽이는 것 같내요.
번호 | 제 목 | 글쓴이 | 날짜 |
---|---|---|---|
2694875 | 부산시 교통카드를 주제로.... (1) | 윤슬이뿌잉 | 2025-05-15 |
2694801 | 콤보박스 대한거 | 윤비 | 2025-05-14 |
2694779 | html 질문여 | 지옥 | 2025-05-14 |
2694732 | 문자 뒤에서 자르기?? | agine | 2025-05-13 |
2694703 | 컴파일이 안되네요 (1) | 옆집꼬마야 | 2025-05-13 |
2694676 | 끄기라는 커맨드버튼을누르면 | 은솔 | 2025-05-13 |
2694560 | 프로그램 차단의 대해서 | 미라 | 2025-05-12 |
2694533 | 비베와 c 중 머가 좋을까요? | 보르미 | 2025-05-12 |
2694504 | 사이트 글 작성 소스 문의 ,, (2) | 마루나 | 2025-05-11 |
2694421 | 리스트 박스... 다음으로 넘어가기? | 난슬 | 2025-05-11 |
2694399 | RegWrite 등록확인방법이있나요? | 하린 | 2025-05-10 |
2694340 | 아스키코드 출력 | 다힘 | 2025-05-10 |
2694286 | 1,900,000 - 백 구십 만원 (6) | 허우룩 | 2025-05-09 |
2694230 | 텍스트복사 | 거북이 | 2025-05-09 |
2694203 | 당신의 지식을 공유해주세요! | 후예 | 2025-05-09 |
2694174 | 디버거 크랙방지 (8) | 덕이 | 2025-05-08 |
2694146 | 수다 사이트글 조회한사람 목록추출가능? (5) | 곰돌츼 | 2025-05-08 |
2694070 | vb_vbnet님의 사이트댓글자동작성기인데 이것을요. | 가시 | 2025-05-07 |
2694041 | 모듈은 무었인가요? | 하람 | 2025-05-07 |
2694013 | 비쥬얼베이직 책 추천좀요^^... | 초코맛캔디 | 2025-05-07 |