Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Программы » AutoIT (Часть 2)

Модерирует : gyra, Maz

Widok (01-06-2010 13:08): Лимит страниц. Продолжаем здесь.  Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

   

ynbIpb



Advanced Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору


Код:
$Process = _ProcessListEx()
$otvet=""
for $i = 1 to $Process[0][0]
    $otvet&= $Process[$i][0]&":"&$Process[$i][1]&" ["&$Process[$i][2]&"]"&@CRLF
next
    MsgBox(0, "Process by MrCreatoR ( _ProcessListEx())", $otvet)
;========================================================================
Func _ProcessListEx($sResourceName="", $sInResString="", $iWholeWord=1)
    Local $aProcList = ProcessList()
    Local $hKernel32_Dll = DllOpen('Kernel32.dll'), $hPsapi_Dll = DllOpen('Psapi.dll')
    Local $aOpenProc, $aProcPath, $sFileVersion, $aRet_List[1][1]
 
    If $hKernel32_Dll = -1 Then Return SetError(1, 0, '')
 
    If $hPsapi_Dll = -1 Then $hPsapi_Dll = DllOpen(@SystemDir & '\Psapi.dll')
    If $hPsapi_Dll = -1 Then $hPsapi_Dll = DllOpen(@WindowsDir & '\Psapi.dll')
    If $hPsapi_Dll = -1 Then Return SetError(2, 0, '')
 
    Local $vStruct   = DllStructCreate('int[1024]')
    Local $pStructPtr   = DllStructGetPtr($vStruct)
    Local $iStructSize  = DllStructGetSize($vStruct)
 
    For $i = 1 To UBound($aProcList)-1
        $aOpenProc = DllCall($hKernel32_Dll, 'hwnd', 'OpenProcess', _
            'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $aProcList[$i][1])
 
        If Not IsArray($aOpenProc) Or Not $aOpenProc[0] Then ContinueLoop
 
        DllCall($hPsapi_Dll, 'int', 'EnumProcessModules', _
            'hwnd', $aOpenProc[0], _
            'ptr', $pStructPtr, _
            'int', $iStructSize, _
            'int_ptr', 0)
 
        $aProcPath = DllCall($hPsapi_Dll, 'int', 'GetModuleFileNameEx', _
            'hwnd', $aOpenProc[0], _
            'int', DllStructGetData($vStruct, 1), _
            'str', '', _
            'int', 2048)
 
        If Not IsArray($aProcPath) Or StringLen($aProcPath[3]) = 0 Then ContinueLoop
 
        $sFileVersion = FileGetVersion($aProcPath[3], $sResourceName)
 
        If $sResourceName = "" Or $sFileVersion = $sInResString Or _
            (
$iWholeWord = 0 And StringInStr($sFileVersion, $sInResString)) Then
 
            $aRet_List[0][0] += 1
            ReDim $aRet_List[$aRet_List[0][0]+1][3]
            $aRet_List[$aRet_List[0][0]][0] = $aProcList[$i][0]     ;Process Name
            $aRet_List[$aRet_List[0][0]][1] = $aProcList[$i][1]     ;PID (Process ID)
            $aRet_List[$aRet_List[0][0]][2] = $aProcPath[3]         ;Process File Path
        EndIf
    Next

 
    DllClose($hKernel32_Dll)
    DllClose($hPsapi_Dll)
 
    If $aRet_List[0][0] < 1 Then Return SetError(3, 0, '')
    Return $aRet_List
EndFunc


Всего записей: 1645 | Зарегистр. 01-05-2006 | Отправлено: 20:41 26-05-2009 | Исправлено: ynbIpb, 16:41 28-05-2009
   

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Программы » AutoIT (Часть 2)
Widok (01-06-2010 13:08): Лимит страниц. Продолжаем здесь.


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru