Jump to content

Recommended Posts

Posted (edited)

it was originally an example for dirty banditos but i decided it was cool enough to post here :lmao:

;Created by Xenogis
;==================
;Customize window titles

Dim $CTitle, $STO
Dim $C1, $W1, $JS, $NC, $TM, $ston = 0

#include <GUIConstants.au3>
#notrayicon
Opt ("GUIOnEventMode", 1)
Opt ("WinTitleMatchMode", 3)

GUICreate("Title Changer", 225, 92, -1, -1, -1, $WS_EX_TOPMOST)
GUISetOnEvent($GUI_EVENT_CLOSE, "quit")
$WTL = GUICtrlCreateLabel("Current window title", 25, 3, 175, 17, $SS_SUNKEN + $SS_CENTER)
$STC = GUICtrlCreateCheckbox("Show time", 3, 23, 70, 20)
$STE = GUICtrlCreateInput("", 80, 23, 135, 20)
GUICtrlCreateLabel("The title will change automaticly as you type.", 9, 46, 215, 20)
GUICtrlCreateButton("Manually Update Title", 50, 69, 120, 20, $BS_DEFPUSHBUTTON)
GUICtrlSetOnEvent(-1, "MUT")
GUISetState()
While 1
    
    If Not (WinGetTitle("") = "Title Changer") And Not (WinGetTitle("") = $CTitle) And Not (WinGetTitle("") = "") Then
        $GTitle = WinGetTitle("")
        If Not ( $CTitle = "Title Changer" ) Then
            $CTitle = $GTitle
            GUICtrlSetData($WTL, $CTitle)
            $W1 = 1
            $JS = 1
            $NC = 0
        EndIf
    ElseIf WinGetTitle("") = "" And $NC = 0 Then
        GUICtrlSetData($WTL, "Titleless Windows Not Supported." )
        $NC = 1
    ElseIf WinGetTitle("") = "Title Changer" And $W1 = 1 Then
        GUICtrlSetData($WTL, $CTitle)
        $W1 = 0
        $NC = 0
    EndIf
    
    If GUICtrlRead($STC) = $GUI_CHECKED And $C1 = 0 And $JS = 1 Then
        $C1 = 1
        ShowTime()
        AdlibEnable("STLoop")
    ElseIf GUICtrlRead($STC) = $GUI_UNCHECKED And $C1 = 1 Then
        $C1 = 0
        AdlibDisable()
        StopTitle()
    EndIf
    
    If Not (GUICtrlRead($STE) = $STO) And Not (GUICtrlRead($STE) = "") And $JS = 1 And Not (GUICtrlRead($WTL) = "Title Changer") And Not ( $CTitle = "Title Changer" ) Then
        If $ston = 0 Then WinSetTitle($CTitle, "", GUICtrlRead($STE))
        $CTitle = GUICtrlRead($STE)
        $title = GUICtrlRead($STE)
        $STO = GUICtrlRead($STE)
        GUICtrlSetData ( $WTL, GUICtrlRead ( $STE ) )
    EndIf
    If Not WinExists ( "Title Changer" ) Then _
        WinSetTitle ( WinGetTitle ( "" ), "", "Title Changer" )
WEnd
Exit

Func ShowTime()
    If Not ($CTitle = "Title Changer") Then
        Global $title, $hwnd
        $ston = 1
        $hwnd = WinGetHandle ( $CTitle )
        $title = $CTitle
        STLoop()
    EndIf
EndFunc

Func STLoop()
    SetTitle($hwnd, $title)
    Sleep(200)
EndFunc

Func SetTitle($h, $t)
    If @HOUR > 12 Then
        $hour = @HOUR - 12
        $pa = " PM"
    Else
        $hour = @HOUR
        $pa = " AM"
    EndIf
        WinSetTitle($h, "", $t & " < " & $hour & ":" & @MIN & ":" & @SEC & $pa & " >")
EndFunc

Func StopTitle()
    WinSetTitle($title, "", $title)
    $ston = 0
EndFunc

Func Quit()
    Exit
EndFunc

Func MUT()
    If Not (GUICtrlRead($STE) = "") And $JS = 1 And Not (GUICtrlRead($WTL) = "Title Changer") And Not ( $CTitle = "Title Changer" ) Then
        WinSetTitle($CTitle, "", GUICtrlRead($STE))
        $CTitle = GUICtrlRead($STE)
        $title = GUICtrlRead($STE)
        GUICtrlSetData ( $WTL, GUICtrlRead ( $STE ) )
    EndIf
EndFunc

ta-da

edit: yeah i know, there are enough title changers

Edited by Xenogis

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Posted (edited)

it was originally an example for dirty banditos but i decided it was cool enough to post here :huh2:

;Created by Xenogis
;==================
;Customize window titles

Dim $CTitle, $STO
Dim $C1, $W1, $JS, $NC, $TM, $ston = 0

#include <GUIConstants.au3>
#notrayicon
Opt ("GUIOnEventMode", 1)
Opt ("WinTitleMatchMode", 3)

GUICreate("Title Changer", 225, 92, -1, -1, -1, $WS_EX_TOPMOST)
GUISetOnEvent($GUI_EVENT_CLOSE, "quit")
$WTL = GUICtrlCreateLabel("Current window title", 25, 3, 175, 17, $SS_SUNKEN + $SS_CENTER)
$STC = GUICtrlCreateCheckbox("Show time", 3, 23, 70, 20)
$STE = GUICtrlCreateInput("", 80, 23, 135, 20)
GUICtrlCreateLabel("The title will change automaticly as you type.", 9, 46, 215, 20)
GUICtrlCreateButton("Manually Update Title", 50, 69, 120, 20, $BS_DEFPUSHBUTTON)
GUICtrlSetOnEvent(-1, "MUT")
GUISetState()
While 1
    
    If Not (WinGetTitle("") = "Title Changer") And Not (WinGetTitle("") = $CTitle) And Not (WinGetTitle("") = "") Then
        $GTitle = WinGetTitle("")
        If Not ( $CTitle = "Title Changer" ) Then
            $CTitle = $GTitle
            GUICtrlSetData($WTL, $CTitle)
            $W1 = 1
            $JS = 1
            $NC = 0
        EndIf
    ElseIf WinGetTitle("") = "" And $NC = 0 Then
        GUICtrlSetData($WTL, "Titleless Windows Not Supported." )
        $NC = 1
    ElseIf WinGetTitle("") = "Title Changer" And $W1 = 1 Then
        GUICtrlSetData($WTL, $CTitle)
        $W1 = 0
        $NC = 0
    EndIf
    
    If GUICtrlRead($STC) = $GUI_CHECKED And $C1 = 0 And $JS = 1 Then
        $C1 = 1
        ShowTime()
        AdlibEnable("STLoop")
    ElseIf GUICtrlRead($STC) = $GUI_UNCHECKED And $C1 = 1 Then
        $C1 = 0
        AdlibDisable()
        StopTitle()
    EndIf
    
    If Not (GUICtrlRead($STE) = $STO) And Not (GUICtrlRead($STE) = "") And $JS = 1 And Not (GUICtrlRead($WTL) = "Title Changer") And Not ( $CTitle = "Title Changer" ) Then
        If $ston = 0 Then WinSetTitle($CTitle, "", GUICtrlRead($STE))
        $CTitle = GUICtrlRead($STE)
        $title = GUICtrlRead($STE)
        $STO = GUICtrlRead($STE)
        GUICtrlSetData ( $WTL, GUICtrlRead ( $STE ) )
    EndIf
    If Not WinExists ( "Title Changer" ) Then _
        WinSetTitle ( WinGetTitle ( "" ), "", "Title Changer" )
WEnd
Exit

Func ShowTime()
    If Not ($CTitle = "Title Changer") Then
        Global $title, $hwnd
        $ston = 1
        $hwnd = WinGetHandle ( $CTitle )
        $title = $CTitle
        STLoop()
    EndIf
EndFunc

Func STLoop()
    SetTitle($hwnd, $title)
    Sleep(200)
EndFunc

Func SetTitle($h, $t)
    If @HOUR > 12 Then
        $hour = @HOUR - 12
        $pa = " PM"
    Else
        $hour = @HOUR
        $pa = " AM"
    EndIf
        WinSetTitle($h, "", $t & " < " & $hour & ":" & @MIN & ":" & @SEC & $pa & " >")
EndFunc

Func StopTitle()
    WinSetTitle($title, "", $title)
    $ston = 0
EndFunc

Func Quit()
    Exit
EndFunc

Func MUT()
    If Not (GUICtrlRead($STE) = "") And $JS = 1 And Not (GUICtrlRead($WTL) = "Title Changer") And Not ( $CTitle = "Title Changer" ) Then
        WinSetTitle($CTitle, "", GUICtrlRead($STE))
        $CTitle = GUICtrlRead($STE)
        $title = GUICtrlRead($STE)
        GUICtrlSetData ( $WTL, GUICtrlRead ( $STE ) )
    EndIf
EndFunc

ta-da

edit: yeah i know, there are enough title changers

<{POST_SNAPBACK}>

Hello Xenogis thx for this nice Autoit3 Gui Title Changer :P:D:P:)

I like it xenogis can you post it later on my forum out pls :whistle:

Thx you) :)

It is your great job and i think share it out pls :lmao:

And thx Thx Mhz for your exampel o:)

Great job Xenogis :)

Edited by DirtyBanditos

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...