skazi69
23-11-2011, 18:10
Как захватить сфернутое окно и отправить туда нажатие кнопки ф1??
нашел на сайте, следующую инфу, а совместить не получается
$hWindow = _ProcessGetWindow("2.bin", 1)
ControlSend($hWindow, "", "Scintilla1", "{ShiftDown}")
Func _ProcessGetWindow($iPID, $iRet = -1)
Local $aWinList = WinList(), $aRet[2]
If IsString($iPID) Then
$iPID = ProcessExists($iPID)
EndIf
For $i = 1 To UBound($aWinList)-1
If BitAND(WinGetState($aWinList[$i][1]), 2) And WinGetProcess($aWinList[$i][1]) = $iPID Then
$aRet[0] = $aWinList[$i][0] ;Title
$aRet[1] = $aWinList[$i][1] ;WinHandle
If $iRet = 0 Then
Return $aRet[0]
EndIf
If $iRet = 1 Then
Return $aRet[1]
EndIf
Return $aRet
EndIf
Next
Return SetError(1, 0, $aRet)
EndFunc
$iSecs = 3 ;Секунды в течений которых следует выслать все клавиши
$iNumKeys = 2 ;Число клавиш которое следует высылать
Opt("SendKeyDelay", ($iSecs * 1000) / $iNumKeys)
If WinWaitActive("Element Client") Then
SendKeepActive("Element Client")
For $iKey = 1 To $iNumKeys
Send("{F" & $iKey & "}")
Next
EndIf
нашел на сайте, следующую инфу, а совместить не получается
$hWindow = _ProcessGetWindow("2.bin", 1)
ControlSend($hWindow, "", "Scintilla1", "{ShiftDown}")
Func _ProcessGetWindow($iPID, $iRet = -1)
Local $aWinList = WinList(), $aRet[2]
If IsString($iPID) Then
$iPID = ProcessExists($iPID)
EndIf
For $i = 1 To UBound($aWinList)-1
If BitAND(WinGetState($aWinList[$i][1]), 2) And WinGetProcess($aWinList[$i][1]) = $iPID Then
$aRet[0] = $aWinList[$i][0] ;Title
$aRet[1] = $aWinList[$i][1] ;WinHandle
If $iRet = 0 Then
Return $aRet[0]
EndIf
If $iRet = 1 Then
Return $aRet[1]
EndIf
Return $aRet
EndIf
Next
Return SetError(1, 0, $aRet)
EndFunc
$iSecs = 3 ;Секунды в течений которых следует выслать все клавиши
$iNumKeys = 2 ;Число клавиш которое следует высылать
Opt("SendKeyDelay", ($iSecs * 1000) / $iNumKeys)
If WinWaitActive("Element Client") Then
SendKeepActive("Element Client")
For $iKey = 1 To $iNumKeys
Send("{F" & $iKey & "}")
Next
EndIf