Line Input:浠ヨ涓哄崟浣嶅彇寰楁枃浠跺唴瀹癸紝浠ヨ涓哄崟浣嶆槸鎸囦粠褰撳墠浣嶇疆寮濮嬪埌涓嬩竴涓崲琛岀涓烘鐨勫唴瀹廣傛崲琛岀鏄疌hr(13) & Chr(10)涓や釜瀛楄妭緇勬垚錛孷B涓凡瀹氫箟浜嗗父閲弙bCrLf錛屽彲鐩存帴浣跨敤銆傝娉ㄦ剰鐨勬槸Line Input璇誨彇涓琛屾椂浼氭妸琛屽熬鐨勬崲琛岀鍘繪帀錛屽洜姝ゆ垜浠湪璇誨彇姣忚鍐呭鏃惰璁板緱琛ヤ笂鎹㈣絎︽墠鑳戒繚鎸佸緱鍒扮殑鍐呭涓庢枃浠朵竴鑷淬?/font>
]]>vb 瀹炵幇鏌ユ壘榪涚▼http://www.tkk7.com/freebird/archive/2006/06/28/55519.htmlfreebirdfreebirdWed, 28 Jun 2006 05:17:00 GMThttp://www.tkk7.com/freebird/archive/2006/06/28/55519.htmlhttp://www.tkk7.com/freebird/comments/55519.htmlhttp://www.tkk7.com/freebird/archive/2006/06/28/55519.html#Feedback0http://www.tkk7.com/freebird/comments/commentRss/55519.htmlhttp://www.tkk7.com/freebird/services/trackbacks/55519.html
vb鏌ユ壘榪涚▼錛岀敤鍒扮殑API鍑芥暟銆?br /> Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long
Private Declare Function Process32First Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long
Private Declare Function Process32Next Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject 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 TerminateProcess Lib "kernel32" (ByVal ApphProcess As Long, ByVal uExitCode As Long) As Long
Private 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 * 1024
End Type
Private Const TH32CS_SNAPHEAPLIST = &H1
Private Const TH32CS_SNAPPROCESS = &H2
Private Const TH32CS_SNAPTHREAD = &H4
Private Const TH32CS_SNAPMODULE = &H8
Private Const TH32CS_SNAPALL = (TH32CS_SNAPHEAPLIST Or TH32CS_SNAPPROCESS Or TH32CS_SNAPTHREAD Or TH32CS_SNAPMODULE)
Private Const TH32CS_INHERIT = &H80000000
Private Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Long Private WM_TASKBARCREATED As Long
'********************************************************************** '鍦ㄦ煡鎵懼嚱鏁?br />'********************************************************************** Private Function FindPro(jinchenming As String) Dim my As PROCESSENTRY32 Dim l As Long Dim l1 As Long Dim mName As String
Dim I As Integer l = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0) If l Then my.dwSize = 1060
If (Process32First(l, my)) Then '閬嶅巻寮濮?/font>
Do I = InStr(1, my.szExeFile, Chr(0))
mName = LCase(Left(my.szExeFile, I - 1))
If mName = jinchenming Then
PID = my.th32ProcessID
pname = mName
Dim mProcID As Long
mProcID = OpenProcess(1&, -1&, PID)
MsgBox pname 'TerminateProcess mProcID, 0&聽
Exit Function End If Loop Until (Process32Next(l, my) < 1) End If l1 = CloseHandle(l) End If End Function