Sign in to follow this  
Followers 0
Trivalik

aquivalent c or c++ code

6 posts in this topic

Hello,

i need the hidden text of an application.

The code is in autoit like:

Opt("WinDetectHiddenText", 1)
MsgBox(0,"",WinGetText("window title"));

Or only the API Function call?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

The code is a little complicated. It requires enumerating through every window on the current desktop to find the one with "window title" and then you have to enumerate all the child windows (controls) of that window to collect all the text.

Edit: Capitalization error.

Edited by Richard Robertson

Share this post


Link to post
Share on other sites

The code is a little complicated. It requires enumerating through every window on the current desktop to find the one with "window title" and then you have to enumerate all the child windows (controls) of that window to collect all the text.

Edit: Capitalization error.

The Window Title or Handle i have. I need only the part of getting the hidden text.

Share this post


Link to post
Share on other sites

I only recently started digging through the AutoIt source code, but I found this part here that might help you:

Ofcourse, this is a piece of Jonathan's code and you will have to ask his permission first if you're going to use it.

if (SendMessage(hWnd, WM_GETTEXTLENGTH, 0, 0) > 0)
{
    // if (SendMessage(hWnd,(UINT)WM_GETTEXT,(WPARAM)AUT_WINTEXTBUFFER,(LPARAM)szBuffer))
    // GetWindowText(hWnd, szBuffer, AUT_WINTEXTBUFFER);
    SendMessage(hWnd, WM_GETTEXT,(WPARAM)AUT_WINTEXTBUFFER,(LPARAM)szBuffer);
    szBuffer[UTIL_WINTEXTBUFFERSIZE] = '';      // Ensure terminated if large amount of return text
}

Share this post


Link to post
Share on other sites

I have try it with the MainWindowHandle, but it comes only the title not the hidden text!

What goes wrong?

Share this post


Link to post
Share on other sites

You need to make a call to each control on the window to get the text. I already said that.

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