-
January 1st, 2006, 12:00 PM
#1
Reading The Text from a Static Control using API
Ive searched all the other posts of this nature and none of them seem to answer my question.
I need to get the text out of a static text object, the problem is that it does not behave like a standard static text object. If i use an API spy it tells me its classname is Static, there are no other children of the MDI window that could be containing the text. But it wont give up the text inside no matter what i throw at it
GetWindowText()
WM_GETTEXT
Nothing seems to work.
The program I am trying to read text from is mIRC, the standard chat windows have
a Static object where the chat is
an Edit object where you type in cmd's / chat
a ListBox item where other clients are listed
there are no other children of that window.
Anyone have any ideas? another way around?
-
January 1st, 2006, 03:06 PM
#2
Re: Reading The Text from a Static Control using API
you can try with Active Accessibility maybe it will work.
download the AccExplorer32.exe and check if you can see the text from there.
if you see the text with it, look at this thread to see how to use ::AccessibleObjectFromWindow(..).
Cheers
-
January 1st, 2006, 10:52 PM
#3
Re: Reading The Text from a Static Control using API
Thats quite a handy little app, but still no response from that static object, no text in there at all.
Looks like ill have to do it the cheap and nasty way, get the logs off the HD
-
January 2nd, 2006, 03:59 AM
#4
Re: Reading The Text from a Static Control using API
The application is probably storing the text in some internal buffer and not in the static control itself. The static control is probably ownerdrawn and the application draws the text on demand using its internal buffer. So i doubt that you can retrieve the text from the static control.
-
January 2nd, 2006, 06:04 PM
#5
Re: Reading The Text from a Static Control using API
Originally Posted by ShCiPwA
Ive searched all the other posts of this nature and none of them seem to answer my question.
I need to get the text out of a static text object, the problem is that it does not behave like a standard static text object. If i use an API spy it tells me its classname is Static, there are no other children of the MDI window that could be containing the text. But it wont give up the text inside no matter what i throw at it
GetWindowText()
WM_GETTEXT
Nothing seems to work.
The program I am trying to read text from is mIRC, the standard chat windows have
a Static object where the chat is
an Edit object where you type in cmd's / chat
a ListBox item where other clients are listed
there are no other children of that window.
Anyone have any ideas? another way around?
Can you post you project or a reference to it.
Assigning it a CStatic control variable in classwizard and using:
nt GetWindowText( LPTSTR lpszStringBuf, int nMaxCount ) const;
void GetWindowText( CString& rString ) const;
has always worked for me. If you want to use the Api you have to get a pointer to Static ID.
... maybe posting your application or a reference to it would help clarify the issue.
Rate this post if it helped you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|