Jump to content

Changing title of a form


Recommended Posts

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 *

Link to comment
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
While 1
    $msg = GuiGetMsg()
    Case $msg = $GUI_EVENT_CLOSE
    ;When button is pressed, label text is changed
    ;to combobox value
    Case $msg = $button1
      $data = GUICtrlRead($Input1)
      GuiCtrlSetData($Label_1, $data)

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)

Link to comment
Share on other sites

  • 1 year later...
  • Moderators

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.

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.

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...