#Include <WinAPIEx.au3>
Local $WindowListArray=WinList()
For $i=1 To UBound($WindowListArray)-1
If $WindowListArray[$i][0]<>"" Then
$Result=_WinAPI_GetProcessName(WinGetProcess($WindowListArray[$i][0]))
If $Result="notepad.exe" Then
MsgBox(0,"notepad.exe",$WindowListArray[$i][0]&"----句柄:"&$WindowListArray[$i][1])
EndIf
EndIf
Next