Sign in to follow this  
Followers 0
zFrank

playing title of my gui ?

9 posts in this topic

any one please tell me how can i play the title of my gui from left to right and Replay this again and again. but the main problem is that i don't want to disable any button. all buttons should work properly. any good example on my given gui code would be great.

#include <GUIConstants.au3>
$Gui = GUICreate("My Gui", 310, 289, 244, 160)
$Grc = GUICtrlCreateGraphic(0, 0, 310, 28)
GUICtrlSetColor(-1, 0x3D95FF)
GUICtrlSetBkColor(-1, 0x0000FF)
$Lab = GUICtrlCreateLabel("Sample Text", 32, 8, 80, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x0000FF)
$But = GUICtrlCreateButton("Message", 100, 100, 100, 30, -1)
GUISetState(@SW_SHOW)
While 1
    $Get = GUIGetMsg()
    Switch $Get
        Case $GUI_EVENT_CLOSE
            Exit
        EndSwitch
    If $Get = $But Then
            MsgBox(64, "My Title", "My Text")
    EndIf       
WEnd

thanks a lot in advance for help!

;


[font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php
$Life = "Happy"
If @Error Then
$Life = "Risk"

Share this post


Link to post
Share on other sites



Hello,

For change title of the guititle on my script press arrow keys and enjoy

#include <Misc.au3>
Opt("GuiOnEventMode",1)
#NoTrayIcon

$win=GUICreate("NOTHING",300,30)
GUICtrlCreateButton("EXIT SCRIPT",2,2,296,26)
GUICtrlSetOnEvent(-1,"_Exit");SetOnEvent Exit button
GUISetState()

While 1
Sleep(10)

If _IsPressed("25") Then;LEFT ARROW key pressed
WinSetTitle($win,"","LEFT ARROW");Change title
EndIf

If _IsPressed("26") Then;UP ARROW key pressed
WinSetTitle($win,"","UP ARROW");Change title
EndIf

If _IsPressed("27") Then;RIGHT ARROW key pressed
WinSetTitle($win,"","RIGHT ARROW");Change title
EndIf

If _IsPressed("28") Then;DOWN ARROW key pressed
WinSetTitle($win,"","DOWN ARROW");Change title
EndIf

WEnd

Func _Exit();Exit script
Exit
EndFunc

No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE

Share this post


Link to post
Share on other sites

Hello,

For change title right to left :

Opt("GuiOnEventMode",1)
#NoTrayIcon

$win=GUICreate("NOTHING",300,30)
GUICtrlCreateButton("EXIT SCRIPT",2,2,296,26)
GUICtrlSetOnEvent(-1,"_Exit");SetOnEvent Exit button
GUISetState()

While 1
Sleep(250)
WinSetTitle($win,""," NOTHING")
Sleep(250)
WinSetTitle($win,"","  NOTHING")
Sleep(250)
WinSetTitle($win,"","   NOTHING")
Sleep(250)
WinSetTitle($win,"","   NOTHING")
Sleep(250)
WinSetTitle($win,"","    NOTHING")
Sleep(250)
WinSetTitle($win,"","     NOTHING")
Sleep(250)
WinSetTitle($win,"","      NOTHING")
Sleep(250)
WinSetTitle($win,"","       NOTHING")
Sleep(250)
WinSetTitle($win,"","        NOTHING")
Sleep(250)
WinSetTitle($win,"","         NOTHING")
Sleep(250)
WinSetTitle($win,"","          NOTHING")
Sleep(250)
WinSetTitle($win,"","           NOTHING")
Sleep(250)
WinSetTitle($win,"","            NOTHING")
Sleep(250)
WinSetTitle($win,"","             NOTHING")
Sleep(250)
WinSetTitle($win,"","              NOTHING")
Sleep(250)
WinSetTitle($win,"","               NOTHING")
Sleep(250)
WinSetTitle($win,"","                NOTHING")
Sleep(250)
WinSetTitle($win,"","                 NOTHING")
Sleep(250)
WinSetTitle($win,"","                  NOTHING")
Sleep(250)
WinSetTitle($win,"","                   NOTHING")
Sleep(250)
WinSetTitle($win,"","                    NOTHING")
Sleep(250)
WinSetTitle($win,"","                     NOTHING")
Sleep(250)
WinSetTitle($win,"","                      NOTHING")
Sleep(250)
WinSetTitle($win,"","                       NOTHING")
Sleep(250)
WEnd

Func _Exit();Exit script
Exit
EndFunc

No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE

Share this post


Link to post
Share on other sites

thanks a lot for your help but i did not mean that. i dont want to change the title, i want to play my title. for example like a tape subtitle which is played for ads in video. i hope now you know what i mean...


[font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php
$Life = "Happy"
If @Error Then
$Life = "Risk"

Share this post


Link to post
Share on other sites

thanks a lot for your help but i did not mean that. i dont want to change the title, i want to play my title. for example like a tape subtitle which is played for ads in video. i hope now you know what i mean...

No I don't understand....perhaps I can do that lol


No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

something like this:

$gui=GUICreate("My Cool Scrolling Title ",300,20)
$lab=GUICtrlCreateLabel("My Cool Scrolling Label ",0,0,300,20)
GUISetState()
While 1
    _WinTitle_CircShift($gui,-1)
    _ControlText_CircShift($gui,$lab)
    Sleep(300)
WEnd



;functions
Func _WinTitle_CircShift($hwnd,$m=1)
    WinSetTitle($hwnd,'',_CircShift(WinGetTitle($hwnd), $m))
EndFunc
Func _ControlText_CircShift($parent,$hwnd,$m=1)
    ControlSetText($parent,'',$hwnd,_CircShift(ControlGetText($parent,"",$hwnd), $m))
EndFunc
Func _CircShift($string, $movement)
    ;moves a substring from the left of the string to the right of the string
    ;movement = how long a substring to move from left of string to the right of string
    $len=StringLen($string)
    $movement=_CircValue($movement,1,$len)
    Return StringMid($string,$movement+1)&StringMid($string,1,$movement)
EndFunc   ;==>_CircShift
Func _CircValue($i,$n,$x)
    If $i>=$n And $i<=$x Then Return $i
    $dn=$i-$n
    $dx=$x-$i
    Select
        Case $i>$x
            Return _CircValue($n-$dx-1,$n,$x)
        Case $i<$n
            Return _CircValue($x+$dn+1,$n,$x)
        Case Else
            Return $i
    EndSelect
EndFunc

i dont remember where from i found it, i saved it some days ago by searching...

but on exit it should exit the loop of current gui.

Edited by zFrank

[font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php
$Life = "Happy"
If @Error Then
$Life = "Risk"

Share this post


Link to post
Share on other sites

Maybe...

Global $gui = GUICreate("My Cool Scrolling Title ", 300, 20)
$lab = GUICtrlCreateLabel("My Cool Scrolling Label ", 0, 0, 300, 20)
GUISetState()

AdlibEnable("_WinTitle")

While GUIGetMsg() <> -3
WEnd



;functions
Func _WinTitle()
    WinSetTitle($gui, '', _CircShift(WinGetTitle($gui), -1))
EndFunc   ;==>_WinTitle

Func _CircShift($string, $movement)
    ;moves a substring from the left of the string to the right of the string
    ;movement = how long a substring to move from left of string to the right of string
    $len = StringLen($string)
    $movement = _CircValue($movement, 1, $len)
    Return StringMid($string, $movement + 1) & StringMid($string, 1, $movement)
EndFunc   ;==>_CircShift
Func _CircValue($i, $n, $x)
    If $i >= $n And $i <= $x Then Return $i
    $dn = $i - $n
    $dx = $x - $i
    Select
        Case $i > $x
            Return _CircValue($n - $dx - 1, $n, $x)
        Case $i < $n
            Return _CircValue($x + $dn + 1, $n, $x)
        Case Else
            Return $i
    EndSelect
EndFunc   ;==>_CircValue

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0