#Include <Array.au3>
;===============================================================================
;
; Function Name: _ProcessGetWinTitle ()
; Description: Gets all windowss associated with a process in a unidimensional array
; Parameter(s): $sProcessName - Name of the process ("Explorer.exe", for instance)
; $iVisibility - Parameter used to check for visible/invisible windowss
; 0 - Check only visible windowss
; 1 - Check for every Window asociated to the specified process
; Requirement(s): <Process.au3> and <Array.au3> are required
; Return Value(s):Success : The array containing the windows name
; Failure : 0
; Author(s): Iuli
;===============================================================================
Func _ProcessGetWinTitle($sProcessName,$iVisibility)
Local $iK, $WinArray
$aWinList=WinList ()
For $iK=1 To $aWinList
If $iVisibility=0 Then
If (_ProcessGetName(WinGetProcess($aWinList[$iK]))=$sProcessName) And (_IsVisible($aWinList[$iK])) Then
_ArrayAdd($WinArray,$aWinList[$iK])
EndIf
ElseIf $iVisibility=1 Then
If _ProcessGetName(WinGetProcess($aWinList[$iK]))=$sProcessName Then
_ArrayAdd($WinArray,$aWinList[$iK])
EndIf
EndIf
Next
Return $WinArray
EndFunc
; ===================================================================================================
; Internal Functions from this point on
; ===================================================================================================
Func _IsVisible($handle)
If BitAnd( WinGetState($handle), 2 ) Then
Return 1
Else
Return 0
EndIf
EndFunc 现在很多人都要向隐藏窗口发送按键命令..................... #Include <WinAPI.au3>
$i=1
Do
a2()
Until $i=3
Func a2()
$hWnd=WinGetHandle( "2061 Online");向隐藏窗口不停的发送空格键
$cv1=_WinAPI_PostMessage($hWnd, 0x0100,32, 0);空格键ASCII码代码为32
EndFunc
我搞定了.....谢谢这么多兄弟的帮忙....... :face (30):强人,没点用 看看,学习学习。 领悟。。。。。。。。 得需要学习啊,学无止境
{:face (125):} 学习了。。。 看看,学习学习。
页:
1
[2]