Jump to content
Sign in to follow this  
AutoITStudent

SCREEN CAPTURE

Recommended Posts

Hi everybody!

I am new to AutoIt, I discovered the language of 1 month and I liked it.

I am working on a script for remote desktop and fail, if you can help me I would be very grateful.

Thanks!

Script:

Client:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("REMOTE VIEW", 1025, 769, -1, -1)
$Pic1 = GUICtrlCreatePic("", 0, 0, 1024, 768, BitOR($SS_NOTIFY,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS), $GUI_WS_EX_PARENTDRAG)

GUISetState(@SW_SHOW)

While True
Local $hDownload = InetGet("http://site.ro/dir/screen.jpg", @ScriptDir & "\screen.jpg", 1, 1)
Do
    Sleep(250)
Until InetGetInfo($hDownload, 3)    ; Check if the download is complete.
Local $aData = InetGetInfo($hDownload)  ; Get all information.
InetClose($hDownload)   ; Close the handle to release resourcs.
If $aData[3] = True Then
Sleep(100)
GUICtrlSetImage($Pic1,@ScriptDir & "\screen.jpg")
EndIf
WEnd

Server:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <FTPEx.au3>
#include <ScreenCapture.au3>

$server = 'ftp'
$username = 'user'
$pass = 'password'
$FTPFile = "/screen.jpg"
$ULFile = @TempDir & "\screen.jpg"

$Open = _FTP_Open('Remote Desktop')
$Conn = _FTP_Connect($Open, $server, $username, $pass)

_ScreenCapture_SetJPGQuality(50)
$hBmp = _ScreenCapture_Capture("")

While True
_ScreenCapture_SaveImage(@TempDir & "\screen.jpg",$hBmp,True)
Sleep(250)
_FTP_FilePut($Conn, $ULFile, $FTPFile)
Sleep(2500)
FileDelete(@TempDir & "\screen.jpg")
Sleep(100)
WEnd

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...