Sign in to follow this  
Followers 0
Toine

Changing title of a form

9 posts in this topic

Hi,

I'm searching a way of changing the title of the main form of my new application.

Thanks to say me if it is possible, and how can I manage this.

Share this post


Link to post
Share on other sites



form? application? change title?

Can you please be more specific?


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

I'm sorry if I'm not really explicit

; Create the GUI window and controls
GuiCreate("MyGUI", 191, 157,(@DesktopWidth-191)/2, (@DesktopHeight-157)/2)
$Label_1 = GuiCtrlCreateLabel("Label1", 30, 40, 131, 21, 0x1000)
$Input1 = GUICtrlCreateInput("", 10,10)
$button1 = GuiCtrlCreateButton("Set Label", 30, 90, 130, 20)

; Run the GUI until it is closed
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    ;When button is pressed, label text is changed
    ;to combobox value
    Case $msg = $button1
      $data = GUICtrlRead($Input1)
      GuiCtrlSetData($Label_1, $data)
    EndSelect
WEnd
Exit

I want to do the same thing but instead of changing the text of a label, I want to change the title of the GUI ("MyGUI" would be replaced by the text typed in the inputbox)

Share this post


Link to post
Share on other sites

Thanks a lot, that's what I was looking for

Share this post


Link to post
Share on other sites

Just what i was looking for ... .thanx :whistle:

Share this post


Link to post
Share on other sites

Hmm...Would be nice if they actually mentioned in the documentation that you can send a window handle instead of the window title.

Share this post


Link to post
Share on other sites

Hmm...Would be nice if they actually mentioned in the documentation that you can send a window handle instead of the window title.

title The title of the window to change. See Title special definition.

From link of "See Title special definitions

Window Handles / HWNDs

The variant datatype in AutoIt natively supports window handles (HWNDs). A window handle is a special value that windows assigns to a window each time it is created. When you have a handle you may use it in place of the title parameter in any of the function calls that use the title/text convention. The advantage of using window handles is that if you have multiple copies of an application open - which have the same title/text - you can uniquely identify them when using handles. When you use a window handle for the title parameter then the text parameter is completely ignored.

Various functions such as WinGetHandle, WinList and GUICreate return these handles. It is important to note that a window handle is not classed as a number or string - it is its own special type.

Note: Window handles will work no matter what WinTitleMatchMode is currently in use.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Touche. I stand corrected. Never saw that last section of the special definitions.

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