StatusBarGetText

Retrieves the text from a standard status bar control.

StatusBarGetText, OutputVar , Part#, WinTitle, WinText, ExcludeTitle, ExcludeText

Parameters

OutputVar

The name of the output variable in which to store the retrieved text.

Part#

If blank or omitted, it defaults to 1, which is usually the part that contains the text of interest. Otherwise, specify the part number of the bar to retrieve, which can be an expression.

WinTitle, WinText, ExcludeTitle, ExcludeText

If each of these is blank or omitted, the Last Found Window will be used. Otherwise, specify for WinTitle a window title or other criteria to identify the target window and/or for WinText a substring from a single text element of the target window (as revealed by the included Window Spy utility).

ExcludeTitle and ExcludeText can be used to exclude one or more windows by their title or text. Their specification is similar to WinTitle and WinText, except that ExcludeTitle does not recognize any criteria other than the window title.

Window titles and text are case-sensitive. By default, hidden windows are not detected and hidden text elements are detected, unless changed with DetectHiddenWindows and DetectHiddenText. By default, a window title must start with the specified WinTitle or ExcludeTitle to be a match, unless changed with SetTitleMatchMode.

Error Handling

[v1.1.04+]: This command is able to throw an exception on failure. For more information, see Runtime Errors.

ErrorLevel is set to 1 if there is a problem or 0 otherwise. If there was a problem, OutputVar is also made blank.

Remarks

This command 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 StatusBarGetText in a loop, it is usually more efficient to use StatusBarWait, which contains optimizations that avoid the overhead of repeated calls to StatusBarGetText.

StatusBarWait, WinGetTitle, WinGetText, ControlGetText

Examples

Retrieves and analyzes the text from the first part of a status bar.

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