Sign in to follow this  
Followers 0
AC130

Change Window Title

14 posts in this topic

#1 ·  Posted (edited)

Nevermind...

Edited by AC130

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

GUIctrlCreateInput returns ID of input control. To get value from input control use GUICtrlRead() .

Edited by ahmet

Share this post


Link to post
Share on other sites

WinSetTitle($wincurtitle, "", GUICtrlRead($ChangeWindowTitle))


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

hi AC130 :huh2:,

With respect to the password thing, try this:

$Input1 = GUICtrlCreateInput("Input1", 10, 10, 100, 21, BitOR($ES_CENTER, $ES_PASSWORD, $ES_AUTOHSCROLL))

-smartee

Share this post


Link to post
Share on other sites

If you want to reset the window title store the last title in a variable and then use WinSeTitle($last_title,"","Calculator") or you can use class of window in first parameter.

Share this post


Link to post
Share on other sites

If you changed the window title to something, your script would have to know what it was changed to. You need to store the new name in a variable before you change it, then look for that title when you want to change it again.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Try this: :huh2:

Opt("MouseCoordMode", 2)        ;1=absolute, 0=relative, 2=client

Share this post


Link to post
Share on other sites

;)

Not to clear on your question :huh2: but here's a quick example of how to store and retrieve some control data :alien:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <String.au3>

$ini = @ScriptDir & "\data.ini"
$section = "controls"

$defaultInput1 = IniRead($ini, $section, "$Input1", "")
If $defaultInput1 <> "" Then $defaultInput1 = _HexToString($defaultInput1)
$defaultEdit1 = IniRead($ini, $section, "$Edit1", "")
If $defaultEdit1 <> "" Then $defaultEdit1 = _HexToString($defaultEdit1)

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Demo 1", 242, 170)
$Input1 = GUICtrlCreateInput($defaultInput1, 12, 12, 217, 21)
$Edit1 = GUICtrlCreateEdit($defaultEdit1, 12, 48, 217, 73)
$Button1 = GUICtrlCreateButton("Save", 12, 132, 73, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            IniWrite($ini, $section, "$Input1", _StringToHex(GUICtrlRead($Input1)))
            IniWrite($ini, $section, "$Edit1", _StringToHex(GUICtrlRead($Edit1)))
    EndSwitch
WEnd

Hope this helps :ph34r:

-smartee

Share this post


Link to post
Share on other sites

AC130, have you EVER read the help files? That's automation 101 as far as the Send command goes. Read the help file before posting such a basic question, and you will probably never have to ask it.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

hi again AC130 ;),

AC130, have you EVER read the help files? That's automation 101 as far as the Send command goes. Read the help file before posting such a basic question, and you will probably never have to ask it.

Umm, a bit straight up, but he's right :huh2:

'!'

This tells AutoIt to send an ALT keystroke, therefore Send("This is text!a") would send the keys "This is text" and then press "ALT+a".

N.B. Some programs are very choosy about capital letters and ALT keys, i.e. "!A" is different to "!a". The first says ALT+SHIFT+A, the second is ALT+a. If in doubt, use lowercase!

'+'

This tells AutoIt to send a SHIFT keystroke, therefore Send("Hell+o") would send the text "HellO". Send("!+a") would send "ALT+SHIFT+a".

'^'

This tells AutoIt to send a CONTROL keystroke, therefore Send("^!a") would send "CTRL+ALT+a".

hmm, perhaps this is more like it? If it isn't please explain a bit more, and show your attempts :alien:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Demo2", 254, 183, 211, 169)
$Input1 = GUICtrlCreateInput("", 12, 12, 229, 21)
$Button1 = GUICtrlCreateButton("-> Edit", 144, 36, 97, 25, $WS_GROUP)
$Edit1 = GUICtrlCreateEdit("", 12, 72, 229, 97)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            GUICtrlSetData($Edit1, GUICtrlRead($Input1))
    EndSwitch
WEnd

Hope this helps :ph34r:

-smartee

Share this post


Link to post
Share on other sites

Don't bump your posts until at least 24 hours has passed, it's very bad forum ettiquette.

Also, please stop asking questions without at least trying to read the help file. It's plainly obvious that you are just trolling for someone to write the script for you and you're not helping do hardly any of the work yourself. Try searching the forums here, there's at least 1000 examples of how to do what you're asking. Please at least attempt to pretend you're doing some of the work yourself.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Hmm does anyone know how to save to edit box? I tried but still no success. I got everything else working though. :huh2:

When are you going to learn to post the code you have tried and isn't working and QUIT bumping threads without showing any effort?

Believe we have been over this before...right?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I tried but still no success,and my friend too

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