Jump to content

Getting text of a status bar ...


Recommended Posts

Hi,

i try to get the text of a status bar in an external application. AutoIt Window Info gives me the handle of that status bar, but it has not controlID. My problem is that i am not able to get this handle programmaticaly. i tried a few things (like ControlGetHandle("Gestion de la GEOBASE V3.1.0","","[CLASS: StatusBarWndClass; INSTANCE: 1]")) but none worked ...

Here is a screenshot of the application ... how should i retrieve that handle ?

When i try a "WinGetClassList" on that window here is what i get :

ToolbarWndClass
ToolbarWindow32
MDIClient
ThunderRT6FormDC
ThunderRT6CheckBox
ThunderRT6TextBox
ThunderRT6CommandButton
ThunderRT6TextBox
ThunderRT6CommandButton
ThunderRT6CommandButton
StatusBarWndClass
AfxOleControl42u

Thanks for ur help !

post-6480-12795442561953_thumb.jpg

Edited by snaileater
Link to comment
Share on other sites

  • Moderators

snaileater,

You do not need the handle, you can use the CLASS and INSTANCE directly. :blink:

Assuming that the Window Info tool can see the text in the status bar, try this:

ControlGetText("Gestion de la GEOBASE V3.1.0", "", "[CLASS: StatusBarWndClass; INSTANCE: 1]")

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

snaileater,

You do not need the handle, you can use the CLASS and INSTANCE directly. :blink:

Assuming that the Window Info tool can see the text in the status bar, try this:

ControlGetText("Gestion de la GEOBASE V3.1.0", "", "[CLASS: StatusBarWndClass; INSTANCE: 1]")

M23

Melba,

i already tried

ControlGetText("Gestion de la GEOBASE V3.1.0", "", "[CLASS: StatusBarWndClass; INSTANCE: 1]")

but for some reasons i don't understand it didn't work...

With the handle given by AutoIt Window Info i can set the Text in that status bar and when set by me i can read the content with things like :

$var = _GUICtrlStatusBar_GetText ($Handle,1)

but when the content is set by the external application it seems i can't reach the content ...

At least i really would like to get the Handle of the status bar ...

Edited by snaileater
Link to comment
Share on other sites

Melba,

The AutoIt Window Info doesn't give me the text of the status bar that's right (but just the handle of the status bar) ... but knowing that i would simply like to find a way to get an handle to the status bar so that i could modify the content by myself ...

Edited by snaileater
Link to comment
Share on other sites

  • Moderators

snaileater,

Sorry about the delay, the Tour de France is more important! ;)

Have you looked at Ascendant's EnumChildWindows UDF to see if it can help?

Other than that I am out of ideas, sorry. :blink:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

snaileater,

Sorry about the delay, the Tour de France is more important! :P

Have you looked at Ascendant's EnumChildWindows UDF to see if it can help?

Other than that I am out of ideas, sorry. ;)

M23

Melba23,

EnumChildWindows does the job, thanks ...

I will have to have a deeper look in this script to understand why i wasn't able to reach the StatusBar Handle ...

Sorry for bothering u during the Tour de France ... :blink:

Link to comment
Share on other sites

  • Moderators

JohnOne,

I had thought of that, but as the Help file says:

This functions 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 which StatusbarGetText cannot read.

and snaileater's status bar appears to be StatusBarWndClass, I thought it not worth pursuing. But perhaps snaileater could try it and see! :blink:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

I see, thanks for the heads up M23.

Snaileater may be interested to know that a nice juicy snail named Sidney recently won a world championship race of 13 inches in a stunning time of 3 minutes 41 seconds according to yesterdays newspapers.

MMmmmm snails

http://www.telegraph.co.uk/news/newstopics/howaboutthat/7897863/Sidney-the-snail-races-to-victory-in-world-championships.html

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

I see, thanks for the heads up M23.

Snaileater may be interested to know that a nice juicy snail named Sidney recently won a world championship race of 13 inches in a stunning time of 3 minutes 41 seconds according to yesterdays newspapers.

MMmmmm snails

http://www.telegraph.co.uk/news/newstopics/howaboutthat/7897863/Sidney-the-snail-races-to-victory-in-world-championships.html

Sad thing that (like in the Tour de France) some snails use prohibited stuff to improve performances ... :blink:
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...