impa,
Код:
#include <WinAPI.au3>
#include <Array.au3>
$sFileExe = @WindowsDir & '\notepad.exe'
$sProcess = StringRegExpReplace($sFileExe, '^.*\\', '')
$iCount = 0
;If Not ProcessExists($sProcess) Then
Run($sFileExe)
;EndIf
$iPID = ProcessWait($sProcess, 5)
If Not $iPID Then
MsgBox(16, 'Error', 'Error')
Exit
EndIf
$aList = WinList()
If Not $aList[0][0] Then
MsgBox(16, 'Error', 'Error')
Exit
EndIf
Dim $aResult[$aList[0][0] + 1][4]
For $i = 1 To $aList[0][0]
If WinGetProcess($aList[$i][1]) = $iPID Then
$iCount += 1
$aResult[$iCount][0] = $aList[$i][0] ;Title
$aResult[$iCount][1] = $aList[$i][1] ;Handle
$aResult[$iCount][2] = _WinAPI_GetClassName($aList[$i][1]);ClassName
If BitAND(WinGetState($aList[$i][1]), 2) Then
$aResult[$iCount][3] = 'visible'
Else
$aResult[$iCount][3] = 'hide'
EndIf
EndIf
Next
If $iCount Then
ReDim $aResult[$iCount + 1][4]
$aResult[0][0] = $iCount
_ArrayDisplay($aResult, 'Все окна процесса ' & $sProcess)
Else
MsgBox(16, 'Error', 'Error')
EndIf