Marquee udf – new release 13 jan 2019 – page 3 – autoit example scripts – autoit forums

Find _Taskbar ( $aMarquee_Coords , $aMarquee_Coords [ 3 ] ) ;Look for the TaskBar ; 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 , 80 ) _GUICtrlMarquee _SetDisplay ( $aMarquee [ 7 ] , 1 , "white" , "black" , 14 , "Comic Sans MS" ) $oMarquee = _GUICtrlMarquee _Create ( $aMarquee [ 7 ] , $sText , 0 , 0 , $aMarquee_Coords [ 2 ] , $aMarquee_Coords [ 3 ] ) GUICtrlSetOnEvent ( $oMarquee , "On_Exit" ) ; 0 Then ; Taskbar at BOTTOM so coords of the marquee are $aMarquee_Coords [ 0 ] = 0 $aMarquee_Coords [ 2 ] = @DesktopWidth $aMarquee_Coords [ 1 ] = @DesktopHeight – $aTaskBar_Pos [ 3 ] – $iGUIh 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 ] $aMarquee_Coords [ 1 ] = @DesktopHeight – $iGUIh ElseIf $aTaskBar_Pos [ 2 ] = @DesktopWidth Then ; Taskbar at TOP so coords of the marquee are $aMarquee_Coords [ 0 ] = 0 $aMarquee_Coords [ 2 ] = @DesktopWidth $aMarquee_Coords [ 1 ] = @DesktopHeight – $iGUIh 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 ] $aMarquee_Coords [ 1 ] = @DesktopHeight – $iGUIh EndIf EndFunc

Find _Taskbar ( $aMarquee_Coords , $aMarquee_Coords [ 3 ] ) ;Look for the TaskBar ; 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 , 80 ) _GUICtrlMarquee _SetDisplay ( $aMarquee [ 7 ] , 1 , "white" , "black" , 14 , "Comic Sans MS" ) $oMarquee = _GUICtrlMarquee _Create ( $aMarquee [ 7 ] , $sText , 0 , 0 , $aMarquee_Coords [ 2 ] , $aMarquee_Coords [ 3 ] ) GUISetOnEvent ( $GUI_EVENT_PRIMARYUP , "On_Exit" , $hGUI ) ; Look for a primary mouse button up on the GUI GUISetState ( ) ; Create the tray menu, this is just for testing since click to close won’t work yet TrayCreateItem ( "Exit" ) TrayItemSetOnEvent ( – 1 , "On_Exit" ) TraySetState ( ) ; main loop While 1 sleep ( 10 ) WEnd Func On _Exit ( ) _GUICtrlMarquee _Delete ( $aMarquee [ 7 ] ) sleep ( 2000 ) ;Just testing to make sure the ticker goes away before closing Exit EndFunc Func Find _Taskbar ( ByRef $aMarquee_Coords , $iGUIh = 60 ) ; Find taskbar and get size Local $aTaskBar_Pos = WinGetPos ( "[CLASS:Shell_TrayWnd]" ) ; If error in finding taskbar If Not IsArray ( $aTaskBar_Pos ) Then $aMarquee_Coords [ 0 ] = 0 $aMarquee_Coords [ 2 ] = @DesktopWidth $aMarquee_Coords [ 1 ] = @DesktopHeight – $aTaskBar_Pos [ 3 ] – 100 – $iGUIh Return EndIf ; 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 $aMarquee_Coords [ 1 ] = @DesktopHeight – $aTaskBar_Pos [ 3 ] – $iGUIh 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 ] $aMarquee_Coords [ 1 ] = @DesktopHeight – $iGUIh ElseIf $aTaskBar_Pos [ 2 ] = @DesktopWidth Then ; Taskbar at TOP so coords of the marquee are $aMarquee_Coords [ 0 ] = 0 $aMarquee_Coords [ 2 ] = @DesktopWidth $aMarquee_Coords [ 1 ] = @DesktopHeight – $iGUIh 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 ] $aMarquee_Coords [ 1 ] = @DesktopHeight – $iGUIh EndIf EndFunc