質問編集履歴
2
ソースコード追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,11 +26,15 @@
|
|
26
26
|
|
27
27
|
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
|
28
28
|
|
29
|
+
Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
|
30
|
+
|
29
31
|
|
30
32
|
|
31
33
|
Private Const WM_CLOSE = &H10
|
32
34
|
|
33
35
|
Private Const SYNCHRONIZE = &H100000
|
36
|
+
|
37
|
+
Private Const PROCESS_TERMINATE = &H1
|
34
38
|
|
35
39
|
|
36
40
|
|
@@ -66,6 +70,22 @@
|
|
66
70
|
|
67
71
|
|
68
72
|
|
73
|
+
' 2016/06/01 16:58 追記
|
74
|
+
|
75
|
+
Private Sub btnTerminateProcess_Click()
|
76
|
+
|
77
|
+
lngPid = Shell("notepad.exe", vbNormalFocus)
|
78
|
+
|
79
|
+
lngWid = OpenProcess(SYNCHRONIZE Or PROCESS_TERMINATE, True, lngPid)
|
80
|
+
|
81
|
+
Call TerminateProcess(lngWid, 0&)
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
End Sub
|
86
|
+
|
87
|
+
|
88
|
+
|
69
89
|
###環境
|
70
90
|
|
71
91
|
Windows7 x64
|
1
若葉マーク
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|