#include #include #include ; used only for _WinAPI_LockWorkStation() $command = @ProgramFilesDir & "\Mozilla Firefox\firefox.exe -new-tab " $url = "http://br-alarmexpertweb.petrobras.com.br/" Run($command & $url, "", @SW_MAXIMIZE) ;If _FFIsConnected() Then ;_FFSetValueById("usuario.login", "cx03",0,0) ; sets the username ; id from the html-input e.g. ; or _FFSetValueByName - depending on the input ;_FFSetValueByName("usuario.login", "cx03",0,0) ;endif Sleep(6000) ;Login na pagina do BR-Alarm MouseClick("left",690,260,1) Send("cx03") Sleep(500) MouseClick("left",690,310,1) Send("karla20{SHIFTDOWN}c{SHIFTUP}") MouseClick("left",800,350,1) Sleep(10000) ;Salvar capture ;#include ; ;Local $networkSharePath = "\\server\images\scan.jpg" ;_ScreenCapture_Capture ( $networkSharePath, 0, 0) ;Dados BR-Alarm OPGQ Local $networkSharePath = "\\s6020as536\peo\documents\publicacoes\eo\opgq\temp" ;;Dados BR-Alarm OPCR ;Local $networkSharePath = "\\s6020as536\peo\documents\publicacoes\eo\opcr\br-alarm" ; Lock screen _WinAPI_LockWorkStation() ;OPCR - Craqueamento $url = "http://br-alarmexpertweb.petrobras.com.br/BR-AlarmExpert/tabelaIndicadores/form/10170" Run($command & $url, "", @SW_MAXIMIZE) Sleep(10000) MouseClick("left",1360,640,1) Sleep(3000) $sFilename = "\\s6020as536\peo\documents\publicacoes\eo\opgq\temp\peo_craq_rpbc_top10_alarmop.png" ;_ScreenCapture_Capture ( $networkSharePath & "\peo_craq_alarmop.png", 265, 145, 1326, 665) ;_CaptureFireFox_Screen("\\s6020as536\peo\documents\publicacoes\eo\opgq\temp\peo_craq_rpbc_top10_alarmop.png") _CaptureFireFox_Screen($sFilename) Sleep(1000) ;Send("{CTRLDOWN}w{CTRLUP}") ;OPCR - Top10 Recap Sleep(1000) MouseClick("left",375,200,1) Sleep(3000) _ScreenCapture_Capture ( $networkSharePath & "\peo_craq_recap_top10_alarmop.png", 282, 175, 1062, 640) Sleep(1000) MouseClick("left",1055,127,1) Sleep(1000) Send("{CTRLDOWN}w{CTRLUP}") Sleep(1000) Send("{CTRLDOWN}w{CTRLUP}") ; #include Func _CaptureFireFox_Screen($sFilename) $hFFox = HWnd(_Firefox_Get_Handle()) If @error Then Return SetError(1, 0, False) ; save the screenshot of the FireFox window to $sFilename ; even while the screen is locked _ScreenCapture_CaptureWnd_mod($sFilename, $hFFox) EndFunc ;==>_CaptureFireFox_Screen ; retrieve the handle of FireFox (and maximize it) Func _Firefox_Get_Handle() ; MozillaWindowClass Local $aList = WinList("[CLASS:MozillaWindowClass]"), $hHandle ; get FirFox handle For $i = 1 To $aList[0][0] If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then $hHandle = $aList[$i][1] ExitLoop EndIf Next If Not $hHandle Then ; MsgBox(0, "Debug", "Problem on getting FireFox handle") Return SetError(1, 0, False) EndIf ; Activate the firefox window and maximize it WinActivate($hHandle) WinSetState($hHandle, '', @SW_MAXIMIZE) Return $hHandle EndFunc ;==>_Firefox_Get_Handle ; #FUNCTION# ==================================================================================================================== ; Author ........: Paul Campbell (PaulIA) ; Modified.......: chimp ; ; modified version of the _ScreenCapture_CaptureWnd() function ; It uses the _WinAPI_PrintWindow() to capture the window ; it should work also with screen locked ; ------------- ; =============================================================================================================================== Func _ScreenCapture_CaptureWnd_mod($sFilename, $hWin, $bCursor = True) Local $bRet = False Local $iSize = WinGetPos($hWin) Local $iW = $iSize[2] Local $iH = $iSize[3] Local $hWnd = _WinAPI_GetDesktopWindow() Local $hDDC = _WinAPI_GetDC($hWnd) Local $hCDC = _WinAPI_CreateCompatibleDC($hDDC) Local $hBMP = _WinAPI_CreateCompatibleBitmap($hDDC, $iW, $iH) ; $hCDC Identifies the device context ; $hBMP Identifies the object to be selected _WinAPI_SelectObject($hCDC, $hBMP) _WinAPI_PrintWindow($hWin, $hCDC) If $bCursor Then Local $aCursor = _WinAPI_GetCursorInfo() If Not @error And $aCursor[1] Then $bCursor = True ; Cursor info was found. Local $hIcon = _WinAPI_CopyIcon($aCursor[2]) Local $aIcon = _WinAPI_GetIconInfo($hIcon) If Not @error Then _WinAPI_DeleteObject($aIcon[4]) ; delete bitmap mask return by _WinAPI_GetIconInfo() If $aIcon[5] <> 0 Then _WinAPI_DeleteObject($aIcon[5]) ; delete bitmap hbmColor return by _WinAPI_GetIconInfo() _WinAPI_DrawIcon($hCDC, $aCursor[3] - $aIcon[2] - $iSize[0], $aCursor[4] - $aIcon[3] - $iSize[1], $hIcon) EndIf _WinAPI_DestroyIcon($hIcon) EndIf EndIf _WinAPI_ReleaseDC($hWnd, $hDDC) _WinAPI_DeleteDC($hCDC) If $sFilename = "" Then Return $hBMP $bRet = _ScreenCapture_SaveImage($sFilename, $hBMP, True) Return SetError(@error, @extended, $bRet) EndFunc ;==>_ScreenCapture_CaptureWnd_mod