Fixed:
- The "no border" setting was ignored.
- Colour values recovered from an ini file (and so passed as strings) were not honoured.
Thanks to AUTTRY for pointing them out.
New UDF and zip below.
Previous releases
My original version of this UDF has been around for some time, but now that it has been modified to allow you to alter the marquee appearance and text "on the fly", I am releasing this much modified version.
Warning: If you used the old version then there are script-breaking changes!! (but see below for how to deal with them)
The UDF allows you to embed scrolling marquees (ticker-tape messages) into your GUIs. There are 6 functions in the library:
;_GUICtrlMarquee_Init : Initialises Marquee control ;_GUICtrlMarquee_SetScroll : Sets movement parameters for Marquee ;_GUICtrlMarquee_SetDisplay : Sets display parameters for Marquee ;_GUICtrlMarquee_Create : Creates Marquee ;_GUICtrlMarquee_Delete : Deletes Marquee control ;_GUICtrlMarquee_Reset : Resets Marquee control to current parameters
- You begin by intialising the UDF using _GUICtrlMarquee_Init - this function returns an index number which you use to refer to that particular marquee when using the other functions. You can have as many marquees as you wish - the index number is there to distinguish between them.
- The GUICtrlMarquee_SetScroll/SetDisplay/Create functions define and create the marquee - as in the earlier UDF version. Note that there are some subtle changes to the way the parameters behave when set to Default/-1, but for the most part they act as before.
- The GUICtrlMarquee_Reset function resets the text of the marquee - as well as implementing any changes to the appearance of the marquee made by further calls to GUICtrlMarquee_SetScroll/SetDisplay since its creation.
- Unsurprisingly, the GUICtrlMarquee_Delete function deletes the marquee.
Here is an example script to show it working:
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include "Marquee.au3" Global $aMarquee_Coords[4] = [0, 0, @DesktopWidth, 60] Global $fMarquee_Pos = "top", $hGUI = 0 ; Create an array to hold the marquee indices Global $aMarquee[8] ; Create GUI to display various marquee styles GUICreate("Marquee Example 1", 320, 320) ; Initialise and create the marquees $aMarquee[0] = _GUICtrlMarquee_Init() _GUICtrlMarquee_Create($aMarquee[0], "Default Marquee Parameters", 10, 10, 300, 20) $aMarquee[1] = _GUICtrlMarquee_Init() _GUICtrlMarquee_SetScroll($aMarquee[1], Default, "alternate", "right", 7) _GUICtrlMarquee_SetDisplay($aMarquee[1], 1, 0xFF0000, 0xFFFF00, 12, "times new roman") _GUICtrlMarquee_Create($aMarquee[1], "Back And Forth", 10, 45, 300, 20) $aMarquee[2] = _GUICtrlMarquee_Init() _GUICtrlMarquee_SetScroll($aMarquee[2], 0, Default, "up", 1) _GUICtrlMarquee_SetDisplay($aMarquee[2], 2, "green", Default, 18, "comic sans ms") _GUICtrlMarquee_Create($aMarquee[2], "Up and Up...", 10, 80, 150, 30, "Vertical Scroll Up") $aMarquee[3] = _GUICtrlMarquee_Init() _GUICtrlMarquee_SetScroll($aMarquee[3], 0, Default, "down", 1) _GUICtrlMarquee_SetDisplay($aMarquee[3], 2, "fuchsia", Default, 18, "comic sans ms") _GUICtrlMarquee_Create($aMarquee[3], "Down We Go", 160, 80, 150, 30, "Vertical Scroll Down") $aMarquee[4] = _GUICtrlMarquee_Init() _GUICtrlMarquee_SetScroll($aMarquee[4], 0, Default, "right", Default, 120) _GUICtrlMarquee_SetDisplay($aMarquee[4], 3, "red", "silver", 12, "arial") _GUICtrlMarquee_Create($aMarquee[4], "And slowly to the right", 10, 120, 300, 26) $aMarquee[5] = _GUICtrlMarquee_Init() _GUICtrlMarquee_SetScroll($aMarquee[5], 1, "slide", Default, 2) _GUICtrlMarquee_SetDisplay($aMarquee[5], 1, "blue", "cyan", 9, "courier new") _GUICtrlMarquee_Create($aMarquee[5], " Just the once", 10, 160, 300, 17) $aMarquee[6] = _GUICtrlMarquee_Init() _GUICtrlMarquee_SetScroll($aMarquee[6]) _GUICtrlMarquee_SetDisplay($aMarquee[6]) _GUICtrlMarquee_Create($aMarquee[6], "Default Marquee Parameters", 10, 190, 300, 20, "Everything at default") ; Create buttons to demonstrate UDF functions $cButton_1 = GUICtrlCreateButton("Change top text", 10, 220, 90, 90, $BS_MULTILINE) $cButton_2 = GUICtrlCreateButton("Delete" & @CRLF & "'Just the once'", 110, 220, 100, 90, $BS_MULTILINE) $cButton_3 = GUICtrlCreateButton("Change Back & Forth", 220, 220, 90, 90, $BS_MULTILINE) GUISetState() ; Look for the TaskBar Find_Taskbar($aMarquee_Coords) ; Create the banner marquee If @error Then MsgBox(0, "Error", "Could not find taskbar") Else Global $sText = "I can be set to either the top or bottom of the display - just click on the tray icon and you can switch me !" ; Create ticker $hGUI = GUICreate("Marquee Example 2", $aMarquee_Coords[2], $aMarquee_Coords[3], $aMarquee_Coords[0], $aMarquee_Coords[1], $WS_POPUPWINDOW, $WS_EX_TOPMOST) $aMarquee[7] = _GUICtrlMarquee_Init() _GUICtrlMarquee_SetScroll($aMarquee[7], 0, Default, "left", Default, 50) _GUICtrlMarquee_SetDisplay($aMarquee[7], 1, 0xFFFF00, 0x88CCFF, 26, "Comic Sans MS") _GUICtrlMarquee_Create($aMarquee[7], $sText, 0, 0, $aMarquee_Coords[2], $aMarquee_Coords[3]) GUISetState() EndIf ; Create the tray menu Opt("TrayOnEventMode", 1) ; Use event trapping for tray menu Opt("TrayMenuMode", 3) ; Default tray menu items will not be shown. ; Only add ticker position options if ticker exists If WinExists($hGUI) Then Global $hTray_Top_Item = TrayCreateItem("Top") TrayItemSetOnEvent(-1, "On_Place") Global $hTray_Bot_Item = TrayCreateItem("Bottom") TrayItemSetOnEvent(-1, "On_Place") TrayCreateItem("") EndIf TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "On_Exit") TraySetState() ; main loop While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton_1 _GUICtrlMarquee_Reset($aMarquee[0], "New text set at " & @HOUR & ":" & @MIN & ":" & @SEC) Case $cButton_2 GUICtrlSetState($cButton_2, $GUI_DISABLE) _GUICtrlMarquee_Delete($aMarquee[5]) Case $cButton_3 GUICtrlSetState($cButton_3, $GUI_DISABLE) ; Change type of scroll _GUICtrlMarquee_SetScroll($aMarquee[1], -1, "scroll", "right", -1) ; Change colours and font _GUICtrlMarquee_SetDisplay($aMarquee[1], 2, 0x0000FF, 0xCCFFCC, 14, "Courier New") ; And redisplay _GUICtrlMarquee_Reset($aMarquee[1], "All different now!") EndSwitch WEnd Func On_Exit() Exit EndFunc Func On_Place() ; Switch ticker position flag If $fMarquee_Pos = "top" Then $fMarquee_Pos = "bottom" Else $fMarquee_Pos = "top" EndIf ; Find taskbar position and move ticker Find_Taskbar($aMarquee_Coords) WinMove($hGUI, "", $aMarquee_Coords[0], $aMarquee_Coords[1], $aMarquee_Coords[2], $aMarquee_Coords[3]) EndFunc Func Find_Taskbar(ByRef $aMarquee_Coords) ; Find taskbar and get size Local $iPrevMode = AutoItSetOption("WinTitleMatchMode", 4) Local $aTaskBar_Pos = WinGetPos("[CLASS:Shell_TrayWnd]") AutoItSetOption("WinTitleMatchMode", $iPrevMode) ; If error in finding taskbar If Not IsArray($aTaskBar_Pos) Then Return SetError(1, 0) ; Determine position of taskbar If $aTaskBar_Pos[1] > 0 Then ; Taskbar at BOTTOM so coords of the marquee are $aMarquee_Coords[0] = 0 $aMarquee_Coords[2] = @DesktopWidth If $fMarquee_Pos = "top" Then $aMarquee_Coords[1] = 0 Else $aMarquee_Coords[1] = @DesktopHeight - $aTaskBar_Pos[3] - 60 EndIf ElseIf $aTaskBar_Pos[0] > 0 Then ; Taskbar at RIGHT so coords of the marquee are $aMarquee_Coords[0] = 0 $aMarquee_Coords[2] = @DesktopWidth - $aTaskBar_Pos[2] If $fMarquee_Pos = "top" Then $aMarquee_Coords[1] = 0 Else $aMarquee_Coords[1] = @DesktopHeight - 60 EndIf ElseIf $aTaskBar_Pos[2] = @DesktopWidth Then ; Taskbar at TOP so coords of the marquee are $aMarquee_Coords[0] = 0 $aMarquee_Coords[2] = @DesktopWidth If $fMarquee_Pos = "top" Then $aMarquee_Coords[1] = $aTaskBar_Pos[3] Else $aMarquee_Coords[1] = @DesktopHeight - 60 EndIf ElseIf $aTaskBar_Pos[3] = @DesktopHeight Then ; Taskbar at LEFT so coords of the marquee are $aMarquee_Coords[0] = $aTaskBar_Pos[2] $aMarquee_Coords[2] = @DesktopWidth - $aTaskBar_Pos[2] If $fMarquee_Pos = "top" Then $aMarquee_Coords[1] = 0 Else $aMarquee_Coords[1] = @DesktopHeight - 60 EndIf EndIf EndFunc
And here is the UDF itself:
#include-once ;#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w- 7 ; #INDEX# ======================================================================================================================= ; Title .........: Marquee ; Description ...: This module contains functions to create and manage marquee controls ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ;_GUICtrlMarquee_Init : Initialises a Marquee control ;_GUICtrlMarquee_SetScroll : Sets movement parameters for Marquee ;_GUICtrlMarquee_SetDisplay : Sets display parameters for Marquee ;_GUICtrlMarquee_Create : Creates Marquee ;_GUICtrlMarquee_Delete : Deletes a marquee control ;_GUICtrlMarquee_Reset : Resets a marquee control to current parameters ; =============================================================================================================================== ; #INTERNAL_USE_ONLY#============================================================================================================ ;================================================================================================================================ ; #INCLUDES# ==================================================================================================================== ; #GLOBAL VARIABLES# ============================================================================================================ ; Array to hold Marquee parameters Global $aMarquee_Params[1][13] = [[0, 0, 0, "scroll", "left", 6, 85, 0, 0, 0, 12, "Tahoma", ""]] ; [0][0] = Count [n][0] = ControlID ; [0][1] [n][1] = Obj Ref ; [0][2] = Def loop state [n][2] = Loop state ; [0][3] = Def move state [n][3] = Move state ; [0][4] = Def move dirn [n][4] = Move dirn ; [0][5] = Def scroll speed [n][5] = Scroll speed ; [0][6] = Def delay time [n][6] = Delay time ; [0][7] = Def border state [n][7] = Border state ; [0][8] = Def text colour [n][8] = Text colour ; [0][9] = Def back colour [n][9] = Back colour ; [0][10] = Def font family [n][10] = Font size ; [0][11] = Def font size [n][11] = Font family ; [0][12] [n][12] = Text ; Get system text and background colours Global $aMarquee_Colours_Ret = DllCall("User32.dll", "int", "GetSysColor", "int", 8) $aMarquee_Params[0][8] = BitAND(BitShift(String(Binary($aMarquee_Colours_Ret[0])), 8), 0xFFFFFF) $aMarquee_Colours_Ret = DllCall("User32.dll", "int", "GetSysColor", "int", 5) $aMarquee_Params[0][9] = BitAND(BitShift(String(Binary($aMarquee_Colours_Ret[0])), 8), 0xFFFFFF) ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlMarquee_Init ; Description ...: Initialises UDF prior to creating a Marquee control ; Syntax.........: _GUICtrlMarquee_Init() ; Parameters ....: None ; Return values .: Index of marquee to be passed to other _GUICtrlMarquee functions ; Author ........: Melba 23 ; Related .......: Other _GUICtrlMarquee functions ; Link ..........; ; Example .......; Yes ; =============================================================================================================================== Func _GUICtrlMarquee_Init() ; Add a new line to the array $aMarquee_Params[0][0] += 1 ReDim $aMarquee_Params[$aMarquee_Params[0][0] + 1][13] ; Copy over the default values For $i = 2 To 12 $aMarquee_Params[$aMarquee_Params[0][0]][$i] = $aMarquee_Params[0][$i] Next ; Return index of marquee in array Return $aMarquee_Params[0][0] EndFunc ;==>_GUICtrlMarquee_Init ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlMarquee_SetScroll ; Description ...: Sets movement parameters for a Marquee ; Syntax.........: _GUICtrlMarquee_SetScroll($iIndex, [$iLoop, [$sMove, [$sDirection, [$iScroll, [$iDelay]]]]]) ; Parameters ....: $iIndex - Index of marquee returned by _GUICtrlMarquee_Init ; $iLoop - [optional] Number of loops to repeat. (Default = infinite, -1 = leave unchanged) ; Use "slide" movement to keep text visible after stopping ; $sMove - [optional] Movement of text. From "scroll" (Default), "slide" and "alternate". (-1 = leave unchanged) ; $sDirection - [optional] Direction of scrolling. From "left" (Default), "right", "up" and "down". (-1 = leave unchanged) ; $iScroll - [optional] Distance of each advance - controls speed of scrolling (Default = 6, -1 = leave unchanged) ; Higher numbers increase speed, lower numbers give smoother animation. ; $iDelay - [optional] Time in milliseconds between each advance (Default = 85, -1 = leave unchanged) ; Higher numbers lower speed, lower numbers give smoother animation. ; Return values .: Success - Returns 1 ; Failure - Returns 0 and sets @error to 1 - @extended set to index of parameter with error ; Author ........: Melba 23 ; Related .......: Other _GUICtrlMarquee functions ; Link ..........; ; Example .......; Yes ; =============================================================================================================================== Func _GUICtrlMarquee_SetScroll($iIndex, $iLoop = Default, $sMove = Default, $sDirection = Default, $iScroll = Default, $iDelay = Default) ; Errorcheck and set parameters Switch $iIndex Case 1 To $aMarquee_Params[0][0] $iIndex = Int($iIndex) Case Else Return SetError(1, 1, 0) EndSwitch Switch $iLoop Case -1 ; No change Case Default $aMarquee_Params[$iIndex][2] = $aMarquee_Params[0][2] Case Else If IsNumber($iLoop) Then $aMarquee_Params[$iIndex][2] = Int(Abs($iLoop)) Else Return SetError(1, 2, 0) EndIf EndSwitch Switch $sMove Case -1 ; No change Case "scroll", 'alternate', 'slide' $aMarquee_Params[$iIndex][3] = $sMove Case Default $aMarquee_Params[$iIndex][3] = $aMarquee_Params[0][3] Case Else Return SetError(1, 3, 0) EndSwitch Switch $sDirection Case -1 ; No change Case 'left', 'right', 'up', 'down' $aMarquee_Params[$iIndex][4] = $sDirection Case Default $aMarquee_Params[$iIndex][4] = $aMarquee_Params[0][4] Case Else Return SetError(1, 4, 0) EndSwitch Switch $iScroll Case -1 ; No change Case Default $aMarquee_Params[$iIndex][5] = $aMarquee_Params[0][5] Case Else If IsNumber($iScroll) Then $aMarquee_Params[$iIndex][5] = Int(Abs($iScroll)) Else Return SetError(1, 5, 0) EndIf EndSwitch Switch $iDelay Case -1 ; No change Case Default $aMarquee_Params[$iIndex][6] = $aMarquee_Params[0][6] Case Else If IsNumber($iDelay) Then $aMarquee_Params[$iIndex][6] = Int(Abs($iDelay)) Else Return SetError(1, 6, 0) EndIf EndSwitch Return 1 EndFunc ;==>_GUICtrlMarquee_SetScroll ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlMarquee_SetDisplay ; Description ...: Sets display parameters for subsequent _GUICtrlCreateMarquee calls ; Syntax.........: _GUICtrlMarquee_SetDisplay($iIndex, [$iBorder, [$vTxtCol, [$vBkCol, [$iPoint, [$sFont]]]]) ; Parameters ....: $iIndex - Index of marquee returned by _GUICtrlMarquee_Init ; $iBorder - [optional] 0 = None (Default), 1 = 1 pixel, 2 = 2 pixel, 3 = 3 pixel (-1 = no change) ; $vTxtCol - [optional] Colour for text (Default = system colour, -1 = no change) ; $vBkCol - [optional] Colour for Marquee (Default = system colour, -1 = no change) ; 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 ; Failure - Returns 0 and sets @error to 1 - @extended set to index of parameter with error ; Author ........: Melba 23 ; Related .......: Other _GUICtrlMarquee functions ; Link ..........; ; Example .......; Yes ; =============================================================================================================================== Func _GUICtrlMarquee_SetDisplay($iIndex, $iBorder = Default, $vTxtCol = Default, $vBkCol = Default, $iPoint = Default, $sFont = Default) ; Errorcheck and set parameters Switch $iIndex Case 1 To $aMarquee_Params[0][0] $iIndex = Int($iIndex) Case Else Return SetError(1, 1, 0) EndSwitch Switch $iBorder Case -1 ; No change Case Default $aMarquee_Params[$iIndex][7] = $aMarquee_Params[0][7] Case 0 To 3 $aMarquee_Params[$iIndex][7] = Int($iBorder) Case Else Return SetError(1, 2, 0) EndSwitch Switch $vTxtCol Case -1 ; No change Case Default $aMarquee_Params[$iIndex][8] = $aMarquee_Params[0][8] Case Else If Number($vTxtCol) Then $aMarquee_Params[$iIndex][8] = Int(Number($vTxtCol)) Else $aMarquee_Params[$iIndex][8] = $vTxtCol EndIf EndSwitch Switch $vBkCol Case -1 ; No change Case Default $aMarquee_Params[$iIndex][9] = $aMarquee_Params[0][9] Case Else If Number($vBkCol) Then $aMarquee_Params[$iIndex][9] = Int(Number($vBkCol)) Else $aMarquee_Params[$iIndex][9] = $vBkCol EndIf EndSwitch Switch $iPoint Case -1 ; No change Case Default $aMarquee_Params[$iIndex][10] = $aMarquee_Params[0][10] Case Else If IsNumber($iPoint) Then $aMarquee_Params[$iIndex][10] = Int(Abs($iPoint / .75)) Else Return SetError(1, 5, 0) EndIf EndSwitch Switch $sFont Case "" ; No change Case Default $aMarquee_Params[$iIndex][11] = $aMarquee_Params[0][11] Case Else If IsString($sFont) Then $aMarquee_Params[$iIndex][11] = $sFont Else Return SetError(1, 5, 0) EndIf EndSwitch Return 1 EndFunc ;==>_GUICtrlMarquee_SetDisplay ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlMarquee_Create ; Description ...: Creates a marquee control ; Syntax.........: _GUICtrlMarquee_Create($iIndex, $sText, $iLeft, $iTop, $iWidth, $iHeight, [$sTipText]) ; Parameters ....: $iIndex - Index of marquee returned by _GUICtrlMarquee_Init ; $sText - The text (or HTML markup) the marquee should display. ; $iLeft - The left side of the control. ; $iTop - The top of the control. ; $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 1 ; Failure - Returns 0 and sets @error as follows ; 1 = Invalid index ; 2 = Index already used ; 3 = Failed to create object ; 4 = Failed to embed object ; 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 other _GUICtrlMarquee functions ; Related .......: Other _GUICtrlMarquee functions ; Link ..........; ; Example .......; Yes ; =============================================================================================================================== Func _GUICtrlMarquee_Create($iIndex, $sText, $iLeft, $iTop, $iWidth, $iHeight, $sTipText = "") ; Errorcheck index Switch $iIndex Case 1 To $aMarquee_Params[0][0] $iIndex = Int($iIndex) Case Else Return SetError(1, 0, 0) EndSwitch ; Check not previously created If $aMarquee_Params[$iIndex][1] <> "" Then Return SetError(2, 0, 0) EndIf ; Store text $aMarquee_Params[$iIndex][12] = $sText ; Create marquee Local $oShell = ObjCreate("Shell.Explorer.2") If Not IsObj($oShell) Then Return SetError(3, 0, 0) Else $aMarquee_Params[$iIndex][1] = $oShell EndIf $aMarquee_Params[$iIndex][0] = GUICtrlCreateObj($oShell, $iLeft, $iTop, $iWidth, $iHeight) If $aMarquee_Params[$iIndex][0] = 0 Then Return SetError(4, 0, 0) EndIf ; Wait for marquee to be created $oShell.navigate("about:blank") While $oShell.busy Sleep(100) WEnd ; Add marquee content 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=" & $aMarquee_Params[$iIndex][2]) .writeln("behavior=" & $aMarquee_Params[$iIndex][3]) .writeln("direction=" & $aMarquee_Params[$iIndex][4]) .writeln("scrollamount=" & $aMarquee_Params[$iIndex][5]) .writeln("scrolldelay=" & $aMarquee_Params[$iIndex][6]) .write(">") .write($sText) .body.title = $sTipText .body.topmargin = 0 .body.leftmargin = 0 .body.scroll = "no" .body.style.borderWidth = $aMarquee_Params[$iIndex][7] .body.style.color = $aMarquee_Params[$iIndex][8] .body.bgcolor = $aMarquee_Params[$iIndex][9] .body.style.fontSize = $aMarquee_Params[$iIndex][10] .body.style.fontFamily = $aMarquee_Params[$iIndex][11] EndWith Return 1 EndFunc ;==>_GUICtrlMarquee_Create ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlMarquee_Delete ; Description ...: Deletes a marquee control ; Syntax.........: _GUICtrlMarquee_Delete($iIndex) ; Parameters ....: $iIndex - Index of marquee returned by _GUICtrlMarquee_Init ; Return values .: Success - Returns 1 ; Failure - Returns 0 and sets @error to 1 ; Author ........: Melba23 ; Remarks .......: ; Related .......: Other _GUICtrlMarquee functions ; Link ..........; ; Example .......; Yes ; =============================================================================================================================== Func _GUICtrlMarquee_Delete($iIndex) ; Errorcheck index Switch $iIndex Case 1 To $aMarquee_Params[0][0] $iIndex = Int($iIndex) Case Else Return SetError(1, 0, 0) EndSwitch ; Remove that entry from the array GUICtrlDelete($aMarquee_Params[$iIndex][0]) For $i = $iIndex To $aMarquee_Params[0][0] - 1 For $j = 0 To UBound($aMarquee_Params, 2) - 1 $aMarquee_Params[$i][$j] = $aMarquee_Params[$i + 1][$j] Next Next ReDim $aMarquee_Params[$aMarquee_Params[0][0]][13] $aMarquee_Params[0][0] -= 1 ; Redraw the other marquees For $i = 1 To $aMarquee_Params[0][0] _GUICtrlMarquee_Reset($i) Next EndFunc ;==>_GUICtrlMarquee_Delete ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlMarquee_Reset ; Description ...: Resets a marquee control to current parameters ; Syntax.........: _GUICtrlMarquee_Reset($iIndex, $sText) ; Parameters ....: $iIndex - Index of marquee returned by _GUICtrlMarquee_Init ; $sText - The text (or HTML markup) the marquee should display (Default leaves text unchanged) ; Return values .: Success - Returns 1 ; Failure - Returns 0 and sets @error as follows ; 1 = Invalid index ; 2 = Invalid object reference ; Author ........: rover ; Modified.......: Melba23 ; Remarks .......: ; Related .......: Other _GUICtrlMarquee functions ; Link ..........; ; Example .......; Yes ; =============================================================================================================================== Func _GUICtrlMarquee_Reset($iIndex, $sText = Default) ; Errorcheck index Switch $iIndex Case 1 To $aMarquee_Params[0][0] $iIndex = Int($iIndex) Case Else Return SetError(1, 0, 0) EndSwitch ; Retrieve object reference $oShell = $aMarquee_Params[$iIndex][1] If Not IsObj($oShell) Then Return SetError(2, 0, 0) EndIf If $sText <> Default Then $aMarquee_Params[$iIndex][12] = $sText EndIf $oShell.document.body.innerHTML = '<body onselectstart="return false" oncontextmenu="return false" onclick="return false" ' & _ 'ondragstart="return false" ondragover="return false"> ' & _ '<marquee width=100% height=100% ' & "loop=" & $aMarquee_Params[$iIndex][2] & _ " behavior=" & $aMarquee_Params[$iIndex][3] & _ " direction=" & $aMarquee_Params[$iIndex][4] & _ " scrollamount=" & $aMarquee_Params[$iIndex][5] & _ " scrolldelay=" & $aMarquee_Params[$iIndex][6] & _ ">" & $aMarquee_Params[$iIndex][12] With $oShell.document .body.style.borderWidth = $aMarquee_Params[$iIndex][7] .body.style.color = $aMarquee_Params[$iIndex][8] .body.bgcolor = $aMarquee_Params[$iIndex][9] .body.style.fontSize = $aMarquee_Params[$iIndex][10] .body.style.fontFamily = $aMarquee_Params[$iIndex][11] EndWith Return 1 EndFunc ;==>_GUICtrlMarquee_SetText
And here are the 2 files in zip format:
Marquee.zip 5.55K
304 downloadsAs always, ready for compliments and/or complaints!
M23
P.S. How to modify your existing marquee scripts:
Edited by Melba23, 06 November 2012 - 01:30 PM.












