- Сообщения
- 5,379
- Репутация
- 2,724
Один из способов избежать мерцаний при прокрутке текста. Для руссифицированной версии Windows замените Wind.jpg на Ветер.jpg.
Код:
#Include <GUIConstantsEx.au3>
#Include <StaticConstants.au3>
#Include <WindowsConstants.au3>
$Width = 420
$Height = 150
$sText = 'AutoIt v3 is a freeware BASIC-like scripting language designed for automating the ' & _
'Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse ' & _
'movement and window/control manipulation in order to automate tasks in a way not possible or ' & _
'reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, ' & _
'self-contained and will run on all versions of Windows out-of-the-box with no annoying "runtimes" ' & _
'required!'
; Main Window
$Form1 = GUICreate('Test', $Width, $Height, 620, 500)
$Pic1 = GUICtrlCreatePic(@WindowsDir & '\Web\Wallpaper\Wind.jpg', 0, 0, 348, 150)
$Label1 = GUICtrlCreateLabel($sText, 0, 150, 348, 150, $SS_CENTER)
GUICtrlSetFont(-1, 10)
GUICtrlSetColor(-1, 0xFFD800)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Close = GUICtrlCreateButton('Close', 354, 105, 60, 40)
GUIRegisterMsg($WM_MOVE, 'WM_MOVE')
$Pos = WinGetPos($Form1)
$Border = ($Pos[2] - $Width) / 2
$X = $Pos[0] + $Border
$Y = $Pos[1] + $Pos[3] - $Height - $Border
; Popup Window
$Form2 = GUICreate('', 348, 150, $X, $Y, BitOR($WS_DISABLED, $WS_POPUP), -1, $Form1)
GUICtrlCreatePic(@WindowsDir & '\Web\Wallpaper\Wind.jpg', 0, 0, 348, 150)
$Label2 = GUICtrlCreateLabel($sText, 0, 150, 348, 150, $SS_CENTER)
GUICtrlSetFont(-1, 10)
GUICtrlSetColor(-1, 0xFFD800)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState(@SW_SHOW, $Form2)
GUISetState(@SW_SHOW, $Form1)
For $i = 150 To -150 Step -1
$Msg = GUIGetMsg()
Switch $Msg
Case $Close, $GUI_EVENT_CLOSE
Exit
EndSwitch
GUICtrlSetPos($Label1, 0, $i)
WinSetTrans($Form2, '', 0)
GUICtrlSetPos($Label2, 0, $i)
WinSetTrans($Form2, '', 255)
Sleep(20)
Next
Func WM_MOVE($hWnd, $iMsg, $wParam, $lParam)
WinMove($Form2, '', BitAND($lParam, 0xFFFF), BitShift($lParam, 16))
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_MOVE