Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <Marquee.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Dim $sText, $label, $inputlabel, $btStyle
; scrolling options
$iLoop=0 ; 0=défile indéfiniment, 1=une fois, 20=vingt fois
$sMove="scroll" ; From "scroll" (Default), "slide" and "alternate"
$sDirection="left" ; From "left" (Default), "right", "up" and "down".
$iScroll=3 ; Distance of each advance - controls speed of scrolling (Default = 6). Higher numbers increase speed, lower numbers give smoother animation.
$iDelay=5 ; Time in milliseconds between each advance (Default = 85). Higher numbers lower speed, lower numbers give smoother animation.
; display options
$iBorder=1 ; 0 = None (Default), 1 = 1 pixel, 2 = 2 pixel, 3 = 3 pixel
$vTxtCol=0x01FE33 ; Colour for text (Default = system colour, -1 = unchanged)
$vBkCol=0x001200 ; Colour for Background (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'
$iSize =30 ; Font size (Default = 12, -1 = unchanged)
$sFont="Airport" ; Font to use (Default = Tahoma, "" = unchanged)
; label options
; The text (or HTML markup) the marquee should display
$sText="12:38 Dès Noël où un zéphyr haï me vêt de glaçons würmiens, je dîne d’exquis rôtis de bœuf au kir à l’aÿ d’âge mûr & cætera !"
$iLeft=10 ; The Left side of the control. If -1 is used then left will be computed according to GUICoordMode.
$iTop=10 ; The Top of the control. If -1 is used then left will be computed according to GUICoordMode.
$iWidth=500 ; The width of the control.
$iHeight=$iSize*1.75; The height of the control.
$sTipTxt="Exemple" ; Tip text displayed when mouse hovers over the control.
; GUI options
$largeurgui=$iWidth+20
$hauteurgui=$iHeight+80
$ecartbouton=10
$largeurbouton=55
$hauteurbouton=25
$btStyle=$BS_DEFPUSHBUTTON
$GUI=GUICreate("GUI",$largeurgui, $hauteurgui,-1,-1, $WS_POPUPWINDOW + $WS_SIZEBOX, $WS_EX_TOOLWINDOW)
GUISetBkColor(0x000000)
GUISetOnEvent($GUI_EVENT_CLOSE, "quit")
_GUICtrlMarquee_SetScroll($iLoop, $sMove, $sDirection, $iScroll, $iDelay)
_GUICtrlMarquee_SetDisplay($iBorder, $vTxtCol, $vBkCol, $iSize, $sFont)
$label=_GUICtrlMarquee_Create($sText, $iLeft, $iTop, $iWidth, $iHeight)
$inputlabel=GUICtrlCreateInput("Entrer votre texte et validez", 10, $iHeight+20, $largeurgui-$largeurbouton -$ecartbouton-$ecartbouton-5, 20)
$BoutonValider = GUICtrlCreateButton("Valider", $largeurgui - $largeurbouton - $ecartbouton, $iHeight+18, $largeurbouton, $hauteurbouton, $btStyle)
$BoutonQuitter = GUICtrlCreateButton("Quitter", $largeurgui - $largeurbouton-$ecartbouton, $iHeight+50, $largeurbouton, $hauteurbouton)
GUICtrlSetOnEvent($BoutonValider, "ChangerText")
GUICtrlSetOnEvent($BoutonQuitter, "quit")
GUISetState()
$monsize=WinGetPos("[ACTIVE]")
GUIRegisterMsg(0x24,'MY_WM_GETSIZE')
Func ChangerText()
$sText = GUICtrlRead($inputlabel)
$label=_GUICtrlMarquee_Create($sText, $iLeft, $iTop, $iWidth, $iHeight)
EndFunc
While(True)
Sleep(10)
WEnd
Func quit()
Exit
EndFunc
Func MY_WM_GETSIZE($hWnd, $Msg, $wParam, $lParam)
Local $minmaxinfo = DllStructCreate('int;int;int;int;int;int;int;int;int;int',$lParam)
DllStructSetData($minmaxinfo,7,$monsize[2]); min X
DllStructSetData($minmaxinfo,8,$monsize[3]); min Y
DllStructSetData($minmaxinfo,9,$monsize[2]); max X
DllStructSetData($minmaxinfo,10,$monsize[3]); max Y
Return $GUI_RUNDEFMSG
EndFunc