Sign in to follow this  
Followers 0
Valiante

Status Bar Text

13 posts in this topic

AutoIt v3 Active Window Info displays the following (among other stuff);

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<
Size:       X: 0    Y: 940  W: 1280 H: 18
Control ID: 59393
ClassNameNN:    msctls_statusbar321
Text:       
Style:      0x5400014E
ExStyle:        0x00000000

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<
(1): Press to display selected entry
(2): JOLLEM
(3):                     
(4): 
(5): NUM
(6): 
(7): 27/03/2006

However when using the following code, nothing is returned;

AutoItSetOption("WinTitleMatchMode", 2)
$x = StatusbarGetText("Touchpaper HelpDesk", "", 2)
MsgBox(0, "Status bar says:", $x)

I'm trying to return the username (JOLLEM) in Touchpaper. How come the window spy sees it, but StatusbarGetText doesn't?

Share this post


Link to post
Share on other sites



This may help:

Some programs use their own status bars or special versions of the MS common control which StatusbarGetText cannot read. For example, StatusbarText does not work on the program TextPad; however, the first region of TextPad's status bar can be read using ControlGetText("TextPad", "", "HSStatusBar1")

StatusbarGetText can work on windows that are minimized or even hidden.

#)

Share this post


Link to post
Share on other sites

Well, my first question: Is this a standard Microsoft window?

Then, since StatusBarGetText() isn't working... Have you tried:

ControlGetText('Touchpaper HelpDesk', '', 'msctls_statusbar321')
?

[center]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.[/center]

Share this post


Link to post
Share on other sites

That is a standard status bar (msctls_statusbar321)

Another thing to try might bet the GuiStatusBar Management in the beta,

1st you would get the handle to the control

i.e.

#include <GuiStatusBar.au3>
$handle = ControlGetHandle('Touchpaper HelpDesk' "", "msctls_statusbar321")
MsgBox(0,"Get Text?",_GuiCtrlStatusBarGetText ($handle , 1)

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

@gafrost: 2 Syntax errors in your example

You missed a bracket in the last line.

EDIT: Also a , in the second line.

Fixed:

#include <GuiStatusBar.au3>
$handle = ControlGetHandle('Touchpaper HelpDesk', "", "msctls_statusbar321")
MsgBox(0,"Get Text?",_GuiCtrlStatusBarGetText ($handle , 1))
Edited by nfwu

Share this post


Link to post
Share on other sites

@gafrost: 2 Syntax errors in your example

You missed a bracket in the last line.

EDIT: Also a , in the second line.

Fixed:

#include <GuiStatusBar.au3>
$handle = ControlGetHandle('Touchpaper HelpDesk', "", "msctls_statusbar321")
MsgBox(0,"Get Text?",_GuiCtrlStatusBarGetText ($handle , 1))
It happens, drinking 1st cup of coffee and haven't even put my glasses on yet :)

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Hi guys - WOW the response is overwhelming! :)

nfwu & SmOke_N: Yeah, as gafrost said this is a standard status bar control, but nevertheless I did try playing around with the ControlGetText function but to no avail (mainly as this only returns the first object in that control and I need the second).

gafrost: Thanks for the info, however it'll take me some time to play around with and test the code as I've only just today downloaded version 3.1.1 (and the 115 beta release) in an effort to try to fix my problem, so as yet I'm not that familiar with the new GUI concepts.

I'll have a go, but do you think it will work considering it utilises the ControlGetText function which (as before) only returns the first object?

Regardless of the outcome, thank you all so much for your help!!

**EDIT** Sorry, I didn't read it properly - I see now it's ControlGetHandle, not Text. Ignore that line!

Edited by Valiante

Share this post


Link to post
Share on other sites

Well not much playing around was needed after all, I see now that the code you provided was a complete script.

However, unfortunately it still returns a blank result. I would give up, but the fact that the Window Spy and see the text makes me think there must be a way to return it in code!

Any other ideas?

Share this post


Link to post
Share on other sites

You may try this: http://www.autoitscript.com/forum/index.ph...topic=14323&hl=

I'm just throwing stabs out there... Also, you say window spy, have you used the AutoInfo.exe tool?


[center]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.[/center]

Share this post


Link to post
Share on other sites

Sorry, yeah - it used to be called "AutoIt Window Spy" in the previous version (which I'm more used to).

I see now that it's "AutoIt Window Info", but essentially the same thing.

Share this post


Link to post
Share on other sites

SmOke_N, I'm sorry - I just can't get my head around that, I'm simply not advanced enough.

I tried downloading the include and example then amended the example to my needs, but it just kept returning an error.

Share this post


Link to post
Share on other sites

Surely wish I could help more... what program are you trying to automate, maybe someone has already done it?


[center]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.[/center]

Share this post


Link to post
Share on other sites

It's called Touchpaper HelpDesk, an IT call-logging tool.

Share this post


Link to post
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
Sign in to follow this  
Followers 0