人太懒!代码写的粗糙!楼主看下原理!自己改改!$list = ProcessList()
for $i = 1 to $list[0][0]
IF StringLeft(_Api_ProcessPath($list[$i][1]),2)="D:" Then ProcessClose($list[$i][1])
next
Func _Api_ProcessPath ( $iPID )
Local $aProc = DllCall ( 'kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR ( 0x0400, 0x0010 ), 'int', 0, 'int',
$iPID )
If $aProc[0] = 0 Then Return SetError ( 1, 0, '' )
Local $vStruct = DllStructCreate ( 'int[1024]' )
DllCall ( 'psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc[0], 'ptr', DllStructGetPtr ( $vStruct ), 'int',
DllStructGetSize ( $vStruct ), 'int*', 0 )
Local $aReturn = DllCall ( 'psapi.dll', 'int', 'GetModuleFileNameEx', 'hwnd', $aProc[0], 'int', DllStructGetData (
$vStruct, 1 ), 'str', '', 'int', 2048 )
If StringLen ( $aReturn[3] ) = 0 Then Return SetError ( 2, 0, '' )
Return $aReturn[3]
EndFunc
|