Window Text By Handle Thread last updated on 2007-08-24 14:15:22

Posted by member 344393 on 2007-08-24 11:11:58

Is there any module / method to retrieve the text content of a window by its handle / class? I'm trying to tie in an xLabel to the temperature values that nvidia monitor spits out as static text in its window.

Posted by member 212670 on 2007-08-24 14:15:22 link

Hmm good question. I don't think there is one?

I threw together a simple script to get it for you in the mean time: lswintxt.exe

You can just run it as: lswintxt "MyVar" "WinTitle"

MyVar will then hold the window text to do whatever you want with. (ex: !alert "$MyVar$")

Note: It uses !SetEvar from xlabel. WinTitle is case sensitive and must be quoted if there are spaces.

edit

I updated the file to change new lines in to < b r > (no spaces) so xlabel will treat them as new lines. Btw, I've been noticing some real inconsistencies on the $var$ being properly set. Sometimes it is, sometimes it isn't. I'm not sure if this is a timing issue with !SetEvar and the speed the var is cleared and reset or what.