Does anyone know how to retrieve the controltext of a msctls_statusbar32 window? (standard Microsoft Cstatus) While the GetControlText> works fine for just the text on the first panel, I actually need to get the text from the 2nd panel.
I am going to assume that this is going to take some VB programming to accomplish.
Randall
Digging into the 2nd panel of a msctls_statusbar32 Question
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
The first panel of a status bar is exposed as caption text, hence you can get it easily with GetControlText. But the rest requires lower level handling and API calls.
Simples solution is to use GetTextInRect. We can get the rectangular bounds of the status bar, then pass these to GetTextInRect to get all the text. Then parse out what you want:
E.g. this works against Notepad++ to get all the status bar text:
Simples solution is to use GetTextInRect. We can get the rectangular bounds of the status bar, then pass these to GetTextInRect to get all the text. Then parse out what you want:
E.g. this works against Notepad++ to get all the status bar text:
Code: Select all
GetTextInit
GetWindowHandle>Notepad++*,HWnd
FindObject>HWnd,msctls_statusbar32,,1,sbHWnd,l,t,r,b,captionText
GetTextInRect>l,t,r,b,AllStatusText
Trim>AllStatusText,AllStatusText
MessageModal>AllStatusText
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?