| || |
How can I Get the text of a VB Application Status Bar?
I'm trying to get the ''Static'' text of a VB app. status bar. I have noticed that the method GetText() does not work in this situation (with the VB application I mean). I have tried to use GetCaption(), but I have noticed that this method will only return the name of this object.
I tried to use record actions, and then verify this Window, but Silk will only read the Caption of this Status Bar.
Things that I have tried:
1. MyVB5.StatusBar.GetText () // this method is not accepted in a VB application 4Test Language.
Note: I have used this method with regular applications, but I found out that it doesn't work with VB applications.
2. MyVB5.StatusBar.GetCaption ()
Therefore, I was wandering if anyone else got any other suggestions .
Re: How can I Get the text of a VB Application Status Bar?
Try to use new class of VB status bar field with undocumented functions. I used code like this:
[-] private winclass OLEStatusBarPanel : Control // undetectable dynamic text
[ ] integer iPanelNumber //virtual
[ ] integer iStartCharToRead = 1 //virtual
[ ] unsupported builtin STRING AgentGetText (INTEGER iStartChar optional, INTEGER iNumChars optional)
[-] hidecalls STRING GetText ( INTEGER iStartChar optional, INTEGER iNumChars optional )
[ ] string sText = WindowParent ( this )._GetItemProp (
''Panels'', this.iPanelNumber, '''', ''Text'' )
[+] if sText == null // this happens for first file loaded if cursor resides ouside draw area
[ ] sText = '''' // because NULL can crash delicate routines
[+] if iStartChar == null
[ ] iStartChar = this.iStartCharToRead
[ ] sText = SubStr ( sText, iStartChar, iNumChars )
[ ] return ApplyY2KRules ( sText, ''GetText'' )
Assign proper value for iPanelNumber for each definition of field on status bar.
const iPanelNumber = 1
const iPanelNumber = 2
and so on.