Jump to content

Name Changer V0.1


Sardith
 Share

Recommended Posts

;Made by: Geoff Haneckow


#include <GUIConstants.au3>
$winName = ""

Opt("GUIOnEventMode", 1)

GUICreate("Name Changer", 220, 200, 0, 0, -1, $WS_EX_TOPMOST)
$Process = GUICtrlCreateButton("Search for Active Process(s)", 10, 10, 200, 20)
GUICtrlSetOnEvent(-1, "Process")
$winLabel = GUICtrlCreateLabel("Select a Process:", 10, 40)
$win = GUICtrlCreateCombo("Select a Window Title", 10, 55, 200, 100)
$winLabel = GUICtrlCreateLabel("Type what you'd like the new name to be:", 10, 85)
$name = GUICtrlCreateInput ("", 10, 100 , 200, 20)
GUICtrlCreateButton("Change name", 10, 135, 200, 20)
GUICtrlSetOnEvent(-1, "Renamepressed")
Process()
GUISetState()

GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")


Func Process()
 ;GUICtrlSetData($win, "|")
    $winList = WinList()
    For $i = 1 To $winList[0][0]
        If $winList[$i][0] <> "" And $winList[$i][0] <> "Program Manager"  And BitAND(WinGetState($winList[$i][0]), 2) Then
            GUICtrlSetData($win, $winList[$i][0])
        EndIf
    Next
EndFunc;==>repopList



Func Renamepressed()
$winName = GUICtrlRead($win)
$label = GUICtrlRead($name)
WinSetTitle($winname, "", $label)
Process()
EndFunc





Do
    $msg = GUIGetMsg()
    Select
        Case $msg = $Process
            Process()
            
        Case $msg = $GUI_EVENT_CLOSE
            GUISetState(@SW_HIDE)
    EndSelect
Until $msg = $GUI_EVENT_CLOSE

Func SpecialEvents()
    

    Select
        Case @GUI_CTRLID = $GUI_EVENT_CLOSE
            Exit
            
        Case @GUI_CTRLID = $GUI_EVENT_MINIMIZE
            
        Case @GUI_CTRLID = $GUI_EVENT_RESTORE
            
    EndSelect
    
EndFunc

Random Title Changer:

CODE

#include <GUIConstants.au3>

$winName = ""

Opt("GUIOnEventMode", 1)

GUICreate("Name Changer", 220, 130, 0, 0, -1, $WS_EX_TOPMOST)

$Process = GUICtrlCreateButton("Search for Active Process(s)", 10, 10, 200, 20)

GUICtrlSetOnEvent(-1, "Process")

$winLabel = GUICtrlCreateLabel("Select a Process:", 10, 40)

$win = GUICtrlCreateCombo("Select a Window Title", 10, 55, 200, 100)

GUICtrlCreateButton("Change name", 10, 100, 200, 20)

GUICtrlSetOnEvent(-1, "Renamepressed")

Process()

GUISetState()

GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")

GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")

GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")

Func Process()

;GUICtrlSetData($win, "|")

$winList = WinList()

For $i = 1 To $winList[0][0]

If $winList[$i][0] <> "" And $winList[$i][0] <> "Program Manager" And BitAND(WinGetState($winList[$i][0]), 2) Then

GUICtrlSetData($win, $winList[$i][0])

EndIf

Next

EndFunc ;==>repopList

Func Renamepressed()

$winName = GUICtrlRead($win)

WinSetTitle($winname, "", Random(100, 10000, 1))

sleep(100)

Process()

EndFunc

Do

$msg = GUIGetMsg()

Select

Case $msg = $Process

Process()

Case $msg = $GUI_EVENT_CLOSE

GUISetState(@SW_HIDE)

EndSelect

Until $msg = $GUI_EVENT_CLOSE

Func SpecialEvents()

Select

Case @GUI_CTRLID = $GUI_EVENT_CLOSE

Exit

Case @GUI_CTRLID = $GUI_EVENT_MINIMIZE

Case @GUI_CTRLID = $GUI_EVENT_RESTORE

EndSelect

EndFunc

Enojy everyone. Hope someone can find it to be useful.

Little update.

Edited by Sardith

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

it has utility if you use it with a "name change reminder". something like, when you use the next time she same window the name remains the changed one. something like "boss name key" :)

AutoIt if more than a hobby. Is a way of life!http://www.autoitscript.com/forum/index.php?showtopic=26002 -my first projecthttp://www.autoitscript.com/forum/index.php?showtopic=26103 -my second project
Link to comment
Share on other sites

Looks interesting, but i cant think of a use for it.

Well if you took the GUI out with all the buttons and all, you could have a nice random name changer for any program that you wanted.

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

  • 2 months later...

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
 Share

  • Recently Browsing   0 members

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