Page 1 of 1

Posted: Tue Aug 06, 2002 6:03 pm
by BackupUser
Restored from previous forum. Originally posted by skypa.

Hi,

this is more an API question, but I hope someone can help me though. I am trying to read out the text of a statusbar (mscomctls_statusbar32), used i.e. at the bottom of the InternetExplorer. Now my problem is, to read out every part of a statusbar, because GetWindowText (or SendMessage_(handle, #WM_GETTEXT) will only work for the first part of the statusbar.
After some searching, I finally found the SB_GETTEXT and SB_SETTEXT variables for the SendMessage API. But if I try to read out the second part of a statusbar, for example, reading out the length of the text (with SB_GETTEXTLENGTH) will work, but not getting the text of it.

length = SendMessage_(handle, #SB_GETTEXTLENGTH, 5,0) ; 5 stands for the 5th part of the statusbar
a$ = Space(length)
SendMessage_(handle, #SB_GETTEXT,length, @a$) ; an this doesn't work

Thanks for help in advance

skypa

Edited by - skypa on 06 August 2002 20:19:35

Posted: Tue Aug 06, 2002 7:05 pm
by BackupUser
Restored from previous forum. Originally posted by Art Sentinel.

Hi skypa,

Firstly did you make a typing error?

length = SendMessage(handle, #SB_GETTEXTLENGTH, 5,0)

should be:

length = SendMessage_(handle, #SB_GETTEXTLENGTH, 5,0)

Secondly, in your code snipplet, you stated that 5 stands for the 5th part of the statusbar? However, according to the WinAPI Docs, the wParam of SB_GETTEXTLENGTH is a Zero-based index of the part from which to retrieve text. This would make the 5th part of the status bar '4'?

Take care.


- Art Sentinel
http://www.artsentinel.net

--------------

Top Ten Reasons Not To Procrastinate:


Coming Soon...

Edited by - Art Sentinel on 06 August 2002 20:07:47

Posted: Tue Aug 06, 2002 7:25 pm
by BackupUser
Restored from previous forum. Originally posted by skypa.

Hi,

first of all, thanks for the answer. Second of all, I made a typing error, of course SendMessage_ is correct.
In addition to this, I think "Zero-Based" means, zero included, because when I tried to get the textlength of the 5th part of the InternetExplorer statusbar, the return value was correct.
However, it doesn't really matter whether 5 or 4, because I tried all the numbers, but I don't get the #sb_gettext to work

Posted: Thu Aug 08, 2002 3:01 pm
by BackupUser
Restored from previous forum. Originally posted by Art Sentinel.

skypa, after much testing I found your solution! (It is actually deceptively simple.) I am writing a tutorial for you right now. I will post it in the Tricks n Tips section in a day or so. :)

Take care.


- Art Sentinel
http://www.artsentinel.net

--------------

Top Ten Reasons Not To Procrastinate:


Coming Soon...

Posted: Thu Aug 08, 2002 3:30 pm
by BackupUser
Restored from previous forum. Originally posted by skypa.
skypa, after much testing I found your solution! (It is actually deceptively simple.) I am writing a tutorial for you right now. I will post it in the Tricks n Tips section in a day or so. :)
Thanks a lot.

Posted: Sat Aug 10, 2002 8:59 pm
by BackupUser
Restored from previous forum. Originally posted by Art Sentinel.

skypa, the tutorial is up, in case you have not seen it yet. I hope this helps you. :)

Take care.


- Art Sentinel
http://www.artsentinel.net

--------------

Top Ten Reasons Not To Procrastinate:


Coming Soon...