找回密码
 加入
搜索
楼主: mmsivws

向隐藏的窗口发送按键或是向进程PID发送按键

  [复制链接]
 楼主| 发表于 2009-7-1 03:49:05 | 显示全部楼层
我的会提示这个错误....我现在玩2061游戏.....想用AU3向隐藏的2061游戏窗口发送空格键.....
发表于 2009-7-1 21:49:05 | 显示全部楼层
改了一下,再试试
发表于 2009-7-2 01:46:11 | 显示全部楼层
#include <Process.au3>
#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[1]
    $aWinList=WinList ()
    For $iK=1 To $aWinList[0][0]
        If $iVisibility=0 Then
            If (_ProcessGetName(WinGetProcess($aWinList[$iK][0]))=$sProcessName) And (_IsVisible($aWinList[$iK][0])) Then
                _ArrayAdd($WinArray,$aWinList[$iK][0])
            EndIf
        ElseIf $iVisibility=1 Then  
            If _ProcessGetName(WinGetProcess($aWinList[$iK][0]))=$sProcessName Then
                _ArrayAdd($WinArray,$aWinList[$iK][0])
            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
 楼主| 发表于 2009-7-2 13:11:54 | 显示全部楼层
现在很多人都要向隐藏窗口发送按键命令.....................
 楼主| 发表于 2009-7-2 15:17:05 | 显示全部楼层
#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


我搞定了.....谢谢这么多兄弟的帮忙.......
发表于 2010-2-6 00:20:07 | 显示全部楼层
强人,没点用
发表于 2011-5-9 16:54:28 | 显示全部楼层
看看,学习学习。
发表于 2011-5-17 16:36:40 | 显示全部楼层
领悟。。。。。。。。
发表于 2011-6-20 09:09:22 | 显示全部楼层
得需要学习啊,学无止境
发表于 2011-6-21 20:40:04 | 显示全部楼层
学习了。。。
发表于 2011-6-22 09:08:48 | 显示全部楼层
看看,学习学习。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-2 01:27 , Processed in 0.071110 second(s), 15 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表