StatusBarGetText

Retrieves the text from a standard status bar control.

Text := StatusBarGetText(Part#, WinTitle, WinText, ExcludeTitle, ExcludeText)

Parameters

Part#

Type: Integer

Which part number of the bar to retrieve. Default 1, which is usually the part that contains the text of interest.

WinTitle

Type: String, Integer or Object

A window title or other criteria identifying the target window. See WinTitle.

WinText

Type: String

If present, this parameter must be a substring from a single text element of the target window (as revealed by the included Window Spy utility). Hidden text elements are detected if DetectHiddenText is ON.

ExcludeTitle

Type: String

Windows whose titles include this value will not be considered.

ExcludeText

Type: String

Windows whose text include this value will not be considered.

Return Value

Type: String

This function returns the text from a single part of the status bar control.

Error Handling

An exception is thrown on failure.

Remarks

This function attempts to read the first standard status bar on a window (Microsoft common control: msctls_statusbar32). Some programs use their own status bars or special versions of the MS common control, in which case the text cannot be retrieved.

Rather than using this function in a loop, it is usually more efficient to use StatusBarWait, which contains optimizations that avoid the overhead of repeated calls to StatusBarGetText.

Window titles and text are case sensitive. Hidden windows are not detected unless DetectHiddenWindows has been turned on.

Related

StatusBarWait, WinGetTitle, WinGetText, ControlGetText

Examples

#1

RetrievedText := StatusBarGetText(1, "Search Results")
if InStr(RetrievedText, "found")
    MsgBox "Search results have been found."