#NoTrayIcon
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=..\..\AutoIt\图标\wucltux_1021.ico
#AutoIt3Wrapper_outfile=OEMGHOST.exe
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <WinAPI.au3>
#include <IE.au3>
#include <WindowsConstants.au3>
Global $iMarquee_Loop = 0
Global $sMarquee_Move = "scroll"
Global $sMarquee_Direction = "left"
Global $iMarquee_Scroll = 6
Global $iMarquee_Delay = 85
Global $iMarquee_Border = 0
Global $vMarquee_TxtCol = Default
Global $sMarquee_BkCol = Default
Global $sMarquee_FontFamily = "Tahoma"
Global $iMarquee_FontSize = 12
Global $i = 0
Global $Array[5] = ["white", "green", "blue", "red", "yellow"] ;字体颜色
$pos = WinGetPos("[class:Shell_TrayWnd]")
$Width = 322
$Height = 122
$Left = @DesktopWidth - 310 ;窗体位置
$Top = @DesktopHeight - 102 - $pos[3] ;窗体位置
;~ $Jpg = "logo.jpg" ;LOGO图片要放在E盘并改名为123
;~ $oIE = _IECreateEmbedded()
;无边框,层叠窗口的属性
$gui = GUICreate("字幕滚动", $Width, $Height, $Left, $Top, $WS_POPUP, $WS_EX_LAYERED)
GUISetBkColor(0xABCDEF) ;设置背景透明,层叠窗口才有效
GUICtrlCreateGroup("", 1, 1, 297, 97);外边框架位置及框架大小
WinSetOnTop("字幕滚动", "", 1);总在最前
;~ $obj = GUICtrlCreateObj($oIE,10, 15, 277, 47) ;图片窗体位置及框架大小
$Pic1 = GUICtrlCreatePic("C:\windows\system32\Devdel\logo.jpg", 10, 15, 277, 47)
;~ _IENavigate($oIE,$Jpg)
;~ $oIE.document.body.scroll="no"
_GUICtrlMarquee_SetScroll(Default, Default, Default, 1, 3) ;2是滚动的速度
_GUICtrlMarquee_SetDisplay(1, $Array[$i], 0xABCDEF)
$Marquee = _GUICtrlMarquee_Create("字幕滚动...字幕滚动 ", 10, 70, 277, 20)
_WinAPI_SetLayeredWindowAttributes($gui, 0xABCDEF)
;~ AdlibRegister ("SetFontColor",1000);此处多了;~表示颜色单一,如果去掉;~那么字体将变成有色文字
GUISetState()
Do
Until GUIGetMsg() = -3
Func SetFontColor()
$i += 1
If $i > 4 Then $i = 0
$Marquee.document.body.style.color = $Array[$i]
EndFunc ;==>SetFontColor
Func _GUICtrlMarquee_SetScroll( $iLoop = 0, $sMove = 'scroll', $sDirection = 'left', $iScroll = 6, $iDelay = 85)
; Errorcheck and set parameters
If IsNumber($iLoop) Then $iMarquee_Loop = Int(Abs($iLoop))
Switch $sMove
Case 'alternate', 'slide'
$sMarquee_Move = $sMove
Case Else
$sMarquee_Move = 'scroll'
EndSwitch
Switch $sDirection
Case 'right', 'up', 'down'
$sMarquee_Direction = $sDirection
Case Else
$sMarquee_Direction = 'left'
EndSwitch
If IsNumber($iScroll) Then $iMarquee_Scroll = Int(Abs($iScroll))
If IsNumber($iDelay) Then $iMarquee_Delay = Int(Abs($iDelay))
EndFunc ;=> _GUICtrlMarquee_SetScroll
; #FUNCTION# ====================================================================================================================
; Name...........: _GUICtrlMarquee_SetDisplay
; Description ...: Sets display parameters for subsequent _GUICtrlCreateMarquee calls
; Syntax.........: _GUICtrlMarquee_SetDisplay([$iBorder, [$vTxtCol, [$vBkCol, [$iPoint, [$sFont]]]])
; Parameters ....: $iBorder - [optional] 0 = None (Default), 1 = 1 pixel, 2 = 2 pixel, 3 = 3 pixel
; $vTxtCol - [optional] Colour for text (Default = system colour, -1 = unchanged)
; $vBkCol - [optional] Colour for Marquee (Default = system colour, -1 = unchanged)
; Colour can be passed as RGB value or as one of the following strings:
; 'black', 'gray', 'white', 'silver', 'maroon', 'red', 'purple', 'fuchsia',
; 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua'
; $iPoint - [optional] Font size (Default = 12, -1 = unchanged)
; $sFont - [optional] Font to use (Default = Tahoma, "" = unchanged)
; Return values .: Success - Returns 0.
; Author ........: Melba 23, based on some original code by james3mg, trancexx and jscript "FROM BRAZIL"
; Related .......: _GUICtrlMarquee_Create, _GUICtrlMarquee_SetScroll, ObjCreate
; Link ..........;
; Example .......; Yes
; ===============================================================================================================================
Func _GUICtrlMarquee_SetDisplay($iBorder = Default, $vTxtCol = Default, $vBkCol = Default, $iPoint = Default, $sFont = Default)
; Errorcheck and set parameters
Select
Case $iBorder = Default
$iMarquee_Border = 0
Case $iBorder >= 0 And $iBorder <= 3
$iMarquee_Border = Int(Abs($iBorder))
Case Else
EndSelect
Select
Case $vTxtCol = Default
$vMarquee_TxtCol = _WinAPI_GetSysColor($COLOR_WINDOWTEXT)
Case IsNumber($vTxtCol) = 1
If $vTxtCol >= 0 And $vTxtCol <= 0xFFFFFF Then $vMarquee_TxtCol = Int($vTxtCol)
Case Else
$vMarquee_TxtCol = $vTxtCol
EndSelect
Select
Case $vBkCol = Default
$sMarquee_BkCol = _WinAPI_GetSysColor($COLOR_WINDOW)
Case IsNumber($vBkCol) = 1
If $vBkCol >= 0 And $vBkCol <= 0xFFFFFF Then $sMarquee_BkCol = Int($vBkCol)
Case Else
$sMarquee_BkCol = $vBkCol
EndSelect
Select
Case $iPoint = Default
$iMarquee_FontSize = 12
Case $iPoint = -1
Case Else
If IsNumber($iPoint) Then $iMarquee_FontSize = Int(Abs($iPoint / .75))
EndSelect
Select
Case $sFont = Default
$sMarquee_FontFamily = "Tahoma"
Case $sFont = ""
Case Else
If IsString($sFont) Then $sMarquee_FontFamily = $sFont
EndSelect
EndFunc ;=> _GUICtrlMarquee_SetDisplay
; #FUNCTION# ====================================================================================================================
; Name...........: _GUICtrlMarquee_Create
; Description ...: Creates a marquee Label control for the GUI
; Syntax.........: _GUICtrlMarquee_Create( $sText, $iLeft, $iTop, $iWidth, $iHeight, [$sTipText])
; Parameters ....: $sText - The text (or HTML markup) the marquee should display.
; $iLeft - The Left side of the control. If -1 is used then left will be computed according to GUICoordMode.
; $iTop - The Top of the control. If -1 is used then left will be computed according to GUICoordMode.
; $iWidth - The width of the control.
; $iHeight - The height of the control.
; $sTipTxt - [optional] Tip text displayed when mouse hovers over the control.
; Return values .: Success - Returns the identifier (controlID) of the new Marquee control.
; Failure - Returns 0
; Author ........: james3mg, trancexx and jscript "FROM BRAZIL"
; Modified.......: Melba23
; Remarks .......: This function attempts to embed an 'ActiveX Control' or a 'Document Object' inside the GUI.
; The GUI functions GUICtrlRead and GUICtrlSet have no effect on this control. The object can only be
; controlled using 'methods' or 'properties' on the $ObjectVar.
; Related .......: _GUICtrlMarquee_SetDisplay, _GUICtrlMarquee_SetScroll, ObjCreate
; Link ..........;
; Example .......; Yes
; ===============================================================================================================================
Func _GUICtrlMarquee_Create($sText, $iLeft, $iTop, $iWidth, $iHeight, $sTipText = "")
; Declar Local variables
Local $oShell, $iCtrlID
$oShell = ObjCreate("Shell.Explorer.2")
If Not IsObj($oShell) Then Return SetError(1, 0, -1)
$iCtrlID = GUICtrlCreateObj($oShell, $iLeft, $iTop, $iWidth, $iHeight)
$oShell.navigate("about:blank")
While $oShell.busy
Sleep(100)
WEnd
With $oShell.document
.write('<style>marquee{cursor: default}></style>')
.write('<body onselectstart="return false" oncontextmenu="return false" onclick="return false" ondragstart="return false" ondragover="return false">')
.writeln('<marquee width=100% height=100%')
.writeln("loop=" & $iMarquee_Loop)
.writeln("behavior=" & $sMarquee_Move)
.writeln("direction=" & $sMarquee_Direction)
.writeln("scrollamount=" & $iMarquee_Scroll)
.writeln("scrolldelay=" & $iMarquee_Delay)
.write(">")
.write($sText)
.body.title = $sTipText
.body.topmargin = 0
.body.leftmargin = 0
.body.scroll = "no"
.body.style.color = $vMarquee_TxtCol
.body.bgcolor = $sMarquee_BkCol
.body.style.borderWidth = $iMarquee_Border
.body.style.fontFamily = $sMarquee_FontFamily
.body.style.fontSize = $iMarquee_FontSize
EndWith
;~ Return $iCtrlID
Return $oShell
EndFunc ;=> _GUICtrlMarquee_Create