#include <WindowsConstants.au3>
#include <WinAPIEx.au3>
#include <GDIPlus.au3>
HotKeySet('{ESC}', '_Exit')
$struct = DllStructCreate('long Left;long Top;long Right;long Bottom')
$struct.Top = '90'
$struct.Bottom = '110'
$width = 600
$height = 200
$Form1 = GUICreate("Form1", $width, $height, -1, -1)
GUISetState(@SW_SHOW)
_GDIPlus_Startup()
Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form1)
Global $hPen = _GDIPlus_PenCreate(0xFFF00000, 20)
$length = 1
$left = 0
$sleft = 0
$slendth = 1
$start = 1
$sleep = 1
While 1
_GDIPlus_GraphicsDrawLine($hGraphic, $left, 100, $length, 100, $hPen)
If $start = 50 Then
While 1
$struct.left = $sleft
$struct.Right = $slendth
_WinAPI_RedrawWindow($Form1, $struct)
_GDIPlus_GraphicsDrawLine($hGraphic, $left + 1, 100, $length + 1, 100, $hPen)
_WinAPI_RedrawWindow($Form1, $struct);обновляется только указанные в структуре координаты окна
If $length = $width Then
While 1
$struct.left = $sleft
$struct.Right = $slendth
_WinAPI_RedrawWindow($Form1, $struct)
If $slendth = 600 Then
$length = 0
$left = -1
$sleft = 0
$slendth = 1
$start = 0
ExitLoop 2
EndIf
$slendth += 1
$sleft += 1
Sleep($sleep)
WEnd
EndIf
$slendth += 1
$sleft += 1
$left += 1
$length += 1
Sleep($sleep)
WEnd
EndIf
$start += 1
$left += 1
$length += 1
Sleep($sleep)
WEnd
Func _Exit()
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_PenDispose($hPen)
_GDIPlus_Shutdown()
Exit
EndFunc ;==>_Exit