hi,
I am current working on Windows XP on 32-bit.
I am trying to fetch the contents displayed in "control panel" window using
GetWindowTextEx>Control Panel,str
But, when I execute the script, sometimes all the contents is not getting stored in 'str'. Some text gets missed for few runs. Please let me know, if there is any way to set the buffer size to str and get all the contents of 'control panel' consistently everytime.
Thanks in advance.
jiby.
'GetWindowTextEx' doesnot fetch full contents everytime
Moderators: Dorian (MJT support), JRL
Launch Control Panel Application From The Command Line
If you want to actually launch a control panel applet, there is a better way:
How To Launch Control Panel Application From The Command Line
http://samanathon.com/how-to-launch-con ... mand-line/
How To Launch Control Panel Application From The Command Line
http://samanathon.com/how-to-launch-con ... mand-line/
Re: 'GetWindowTextEx' doesnot fetch full contents everytime
jiby wrote:hi,
I am current working on Windows XP on 32-bit.
I am trying to fetch the contents displayed in "control panel" window using
GetWindowTextEx>Control Panel,str
But, when I execute the script, sometimes all the contents is not getting stored in 'str'. Some text gets missed for few runs. Please let me know, if there is any way to set the buffer size to str and get all the contents of 'control panel' consistently everytime.
Thanks in advance.
jiby.
I have similar experiences with the GetWindowTextEx command with Windows 7. Sometimes some of the text is simply missing. Use of the GetTextReset command doesnt help. I haven't tried your script with the control panel but your problem appears to be the same as I have seen on numerous occasions. It is my understanding that the text dll's (GetWordNT and ICall) come from another vendor. The version (3.3.1.136 ) that comes with MS v12 is the same as was in MS v11. Maybe it's time to explore newer versions ??
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
There is no new version yet. We're waiting on new ones.
However, I don't think a new version will necessarily fix this problem. I think what is happening is that at the precise time the text capture functions are called the application that performs the text out processing is in a kind of idle state, or not at that moment outputting text. Imagine the text out functions as if they were being broadcast like radio. These functions are intercepted. We don't actually read from the screen itself - that isn't possible without using OCR. Instead we intercept the function calls. We need to intercept them when they are actually called. If you imagine it is like intercepting a radio signal then if we were unlucky enough to listen at a quiet moment we'd hear nothing.
Therefore what I do is use a loop. If I'm sure I will get something at some point then I will call GetWindowTextEx in a loop until something is returned.
However, I don't think a new version will necessarily fix this problem. I think what is happening is that at the precise time the text capture functions are called the application that performs the text out processing is in a kind of idle state, or not at that moment outputting text. Imagine the text out functions as if they were being broadcast like radio. These functions are intercepted. We don't actually read from the screen itself - that isn't possible without using OCR. Instead we intercept the function calls. We need to intercept them when they are actually called. If you imagine it is like intercepting a radio signal then if we were unlucky enough to listen at a quiet moment we'd hear nothing.
Therefore what I do is use a loop. If I'm sure I will get something at some point then I will call GetWindowTextEx in a loop until something is returned.
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?
-
- Pro Scripter
- Posts: 63
- Joined: Thu Dec 10, 2009 8:13 am
I use this:
Code: Select all
/*TO GET THE TEXT PROPERLY FROM THE SCREEN HAVING
HAVING THE A KEY TEXT
NOTE: THE KEY TEXT MUST BE PRESENT ELSE IT WILL HANG...
*/
SRT>GET_PROPER_TEXT
Let>isPoP_proper=0
Repeat>isPoP_proper
GetTextReset
SetFocus>GET_PROPER_TEXT_Var_1
WaitReady>0
GetWindowTextEx>GET_PROPER_TEXT_Var_1,str_proper
RegEx>GET_PROPER_TEXT_Var_2,str_proper,0,,isPoP_proper,0
Until>isPoP_proper<>0
END>GET_PROPER_TEXT
//GET_PROPER_TEXT FINISHED
//Syntax: GoSub>GET_PROPER_TEXT,terminal_name,unique key text
GoSub>GET_PROPER_TEXT,Control Panel,Switch\s+to\s+(Category|Classic)\s+View
MDL>str_proper