WindowGetTitle

Syntax

Title$ = WindowGetTitle(Window)

Description

Retrieves the current text displayed in the title bar of the specified ProGUI window.

Parameters

Window
The handle of the ProGUI window whose title is to be retrieved.

Return Value

Returns the window title as a string. Returns an empty string ("") if the window handle is invalid or if the window has no title.

Remarks

This function retrieves the title currently set for the window, which might have been set initially with CreateWindow() or later with WindowSetTitle().

Example

IncludeFile "ProGUI_PB.pbi"

StartProGUI()

MyWindow = CreateWindow(0, 0, 300, 200, "Initial Title")

If MyWindow
  WindowShow(MyWindow, #True, #PG_Window_ScreenCentered)

  CurrentTitle$ = WindowGetTitle(MyWindow)
  Debug "Current Window Title: " + CurrentTitle$

  ; Change the title
  WindowSetTitle(MyWindow, "New Title")
  Debug "Updated Window Title: " + WindowGetTitle(MyWindow)


  Repeat
    Event = WaitWindowEvent()
  Until Event = #PB_Event_CloseWindow
EndIf

StopProGUI()

See Also

CreateWindow, WindowSetTitle

Supported OS

Windows, Linux