Sign in to follow this  
Followers 0
butji

why doesnt THIS work?

7 posts in this topic

ok

what ever i write in GUICtrlCreateInput the value allways is 4... why? if you dont understand ask.

#include <GUIConstants.au3>

GUICreate( "butji's msoft iexplorer title changer" )
GUISetState (@SW_SHOW)
$string = GUICtrlCreateButton( "Create string", 10,10)
$name = GUICtrlCreateInput( "", 100, 10, 100)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $string
            RegWrite( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Window Title", "REG_SZ", $name)
    EndSelect
Wend

Share this post


Link to post
Share on other sites



$name is just the id of the control. You need to use GUICtrlRead() to get the text.

So thats like this:

#include <GUIConstants.au3>

GUICreate( "butji's msoft iexplorer title changer" ) ;Creates the GUI
$string = GUICtrlCreateButton( "Create string", 10,10) ;Creates the button
$name = GUICtrlCreateInput( "", 100, 10, 100) ; Creates the input

GUISetState (@SW_SHOW) ; Shows the GUI should probably be Here....

While 1 ;While Loop
    $msg = GUIGetMsg() ;Gets msgs from the GUI
    Select
        Case $msg = $GUI_EVENT_CLOSE ; If the exit button is pressed on the GUI, then close.
            ExitLoop ;Exit the Loop
        Case $msg = $string
            $NewName = GUICtrlRead ($name);Reads the input box's data
            RegWrite( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Window Title", "REG_SZ", $NewName);Sets the title
    EndSelect
Wend

Share this post


Link to post
Share on other sites

@xcal u is teh pro

Share this post


Link to post
Share on other sites

u too bert!

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