Jump to content

why doesnt THIS work?

Recommended Posts


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()
        Case $msg = $GUI_EVENT_CLOSE
        Case $msg = $string
            RegWrite( "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Window Title", "REG_SZ", $name)
Link to comment
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
        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
Link to comment
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

  • Recently Browsing   0 members

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