Jump to content

Unable to access hidden text


Go to solution Solved by ioa747,

Recommended Posts

Posted

I'm trying to access some hidden text on an application form. I can see the text I want on the hidden tab in the inspection tool and I can see the window title. The window is open and active but all I get for a return is a message box that says Hidden Text and 0 for a return. If I understand the commands correctly, it should show me all the text on the page (including hidden text). I tried the same thing with ControlGetText identifying the specific control but it yields the same result. I also tried sending ^a and ^c then reading the clipboard with no success either (though it clearly selects everything on the page). I'm guessing it has to do with the window title but the inspection tool clearly says its SEM. The application window I'm trying to pull from is older software from maybe written around 2010--2015 originally on Win 7 but currently running on Win10 if that helps. What confuses me is I can see the text in the AutoIT inspection tool but can't figure out how to access it. Any help or insight would be appreciated.

Opt("WinDetectHiddenText", 1)

$text = WinGetText("[SEM]")

MsgBox(0, "Hidden Text", $text)

 

 

Should I try something like, Opt("WinTitleMatchMode", 2)  to match partial window titles? I've never had to do that before....

Posted (edited)

The syntax $text = WinGetText("[SEM]") could be problematic due to the use of square brackets.

try this approach:

;~ #RequireAdmin 
Opt("WinTitleMatchMode", 2)   ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase
Opt("WinDetectHiddenText", 1) ;0=don't detect, 1=do detect

$hWnd = WinGetHandle("[TITLE:SEM; CLASS:...]") 
ConsoleWrite("$hWnd=" & $hWnd & @CRLF)

$text = WinGetText($hWnd) 
ConsoleWrite("$text=" & $text & @CRLF)

Make sure you replace CLASS:... with the actual class name from the Info Tool   (e.g., CLASS:#32770 or CLASS:TForm1).

Edited by ioa747
update

I know that I know nothing

Posted

I tried the code you sent and it also produces no text. The hwnd it came back with didnt match any of the handles for any of the controls or windows I could see. I may have found something though. The page I'm looking at has over 50 instances of windows and controls overlaid. It's difficult to tell exactly which window you are looking at. I tried a number of these instances and I can get text from some of them. I think I just need to work through all the instances until I find the exact one. I'm not sure how the inspection tool pulls what I want so easily but I think I can get there. Whoever wrote the application I'm looking at was either brilliant or insane....not sure which.

Thanks for the help

  • Solution
Posted

variation:

;~ #RequireAdmin 
Opt("WinTitleMatchMode", 2)   ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase
Opt("WinDetectHiddenText", 1) ;0=don't detect, 1=do detect
Opt("WinSearchChildren", 1)   ;0=no, 1=search children also


$hWnd = WinGetHandle("[TITLE:SEM; CLASS:...]", "YourUniqueHiddenTextHere") 
ConsoleWrite("$hWnd=" & $hWnd & @CRLF)

$text = WinGetText($hWnd) 
ConsoleWrite("$text=" & $text & @CRLF)

Make sure you replace CLASS:... with the actual class name from the Info Tool   (e.g., CLASS:#32770 or CLASS:TForm1).
and the "YourUniqueHiddenTextHere" , with word or phrase from the 'Hidden Text' tab of the Info Tool that only appears on the specific page or tab you are trying to access

I know that I know nothing

Posted

Interesting....check everywhere and get me the handle where the secret text appears......Hmmm, clever.  Will try this shortly.

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
×
×
  • Create New...