#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("滚动文字", 600, 40, 192, 654,$WS_POPUP, $WS_EX_LAYERED)
;$WGP = WinGetPos($Form1)
GUISetBkColor(0xABCDEF)
$txt = "中广网北京5月8日消息据中国之声《全国新闻联播》18时30分报道,应俄罗斯联邦总统梅德韦杰夫邀请,国家主席胡锦涛当地时间8号下午抵达莫斯科,出席俄罗斯纪念卫国战争胜利65周年庆典"
$Label1 = GUICtrlCreateLabel($txt, 0, 0, StringLen ($txt)*40, 40)
;MsgBox(0,StringLen ($txt)*40,$txt)
GUICtrlSetColor($Label1, 0xe000ff)
GUICtrlSetFont($Label1, 30, 400)
GUISetState(@SW_SHOW)
;WinSetOnTop("滚动文字", "", 1)
_API_SetLayeredWindowAttributes($Form1, 0xABCDEF)
move()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func move()
$s = StringLen ($txt) + 600
Do
ControlMove('', '', $Label1, $s - 1, 0)
$s -= 1
Sleep(5)
Until $s = -StringLen ($txt)*50
MsgBox(0,0,'滚动完毕')
Exit
EndFunc
Func _API_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $isColorRef = False)
Local Const $AC_SRC_ALPHA = 1
Local Const $ULW_ALPHA = 2
Local Const $LWA_ALPHA = 0x2
Local Const $LWA_COLORKEY = 0x1
If Not $isColorRef Then
$i_transcolor = Hex(String($i_transcolor), 6)
$i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
EndIf
Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $LWA_COLORKEY + $LWA_ALPHA)
Select
Case @error
Return SetError(@error, 0, 0)
Case $Ret[0] = 0
Return SetError(4, 0, 0)
Case Else
Return 1
EndSelect
EndFunc
解决问题: