AutoHotkey Community

It is currently May 26th, 2012, 5:50 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: April 24th, 2009, 10:31 pm 
Offline

Joined: April 24th, 2009, 10:25 pm
Posts: 6
Hi!!
I've just discover this splendid "autohotkey" utility.... :P
I would like to know how is it possible reading char text in a win32 console based program...... (video is text char 80x25)very similiar to old dos application....
I have read the manual, but, I'm newbie, so I've not found the answer :cry:

May you help me please?

Thanks to all

Danrevella


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 24th, 2009, 11:19 pm 
Quote:
reading char text in a win32 console based program
What's his name?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 25th, 2009, 1:15 am 
Offline

Joined: April 24th, 2009, 10:25 pm
Posts: 6
Shelly wrote:
Quote:
reading char text in a win32 console based program
What's his name?

This f.e.:
http://www.dposoft.net/
hdd regenerator


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 25th, 2009, 3:57 am 
This has been asked and answered many times (but I don't remember just where). Search the forums and you will find the answer(s).

Search tips:
method 1 (forum), method 2 (site), method 3 (Google).


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 25th, 2009, 4:19 pm 
Offline

Joined: April 24th, 2009, 10:25 pm
Posts: 6
Anonymous wrote:
This has been asked and answered many times (but I don't remember just where). Search the forums and you will find the answer(s).

Search tips:
method 1 (forum), method 2 (site), method 3 (Google).

I have search for......
But, maybe I don't understand or maybe I think that all the process may be really simple, but I'm unable in solving the problem (me guilty..)
Image
For example, in row: 21 and column:6 we may read the start of the text:
"Enter choice [ ]", but I have NOT found any command able in manage these simple "dos" coordinate....
This is a real program, who run in his win32 console process, I may send key to him, but I'm unable in reading the text...

Thanks for your patience.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 25th, 2009, 9:49 pm 
Because you know that static text, and you know which option you wanna select, simply detect the window, set it on focus, send the key. Done


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 26th, 2009, 6:10 pm 
Offline

Joined: April 24th, 2009, 10:25 pm
Posts: 6
Shelly wrote:
Because you know that static text, and you know which option you wanna select, simply detect the window, set it on focus, send the key. Done

As I told before, I may send key to the window, but I have to read the generate text AFTER, and then perform a CONDITIONAL selection, but I may NOT know what have to do after if I'm unable in reading text.
For example I may select option 1) Then if is ok I may pass to the next job, but if it failed, I have to perform another selection...

Many thanks, BTW


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 27th, 2009, 7:10 pm 
Offline

Joined: April 24th, 2009, 10:25 pm
Posts: 6
danrevella wrote:
Shelly wrote:
Because you know that static text, and you know which option you wanna select, simply detect the window, set it on focus, send the key. Done

As I told before, I may send key to the window, but I have to read the generate text AFTER, and then perform a CONDITIONAL selection, but I may NOT know what have to do after if I'm unable in reading text.
For example I may select option 1) Then if is ok I may pass to the next job, but if it failed, I have to perform another selection...

Many thanks, BTW

Uhm....
Maybe I have to read a char one pixel at time? :-)))


Report this post
Top
 Profile  
Reply with quote  
PostPosted: April 27th, 2009, 11:14 pm 
Offline

Joined: June 8th, 2008, 11:50 pm
Posts: 9
Location: Spain - Madrid
Hi:

I've tried WinGetText (which I have in a hotkey), but doesn't work.

I don't know by heart the exact commands, but I would look in the manual how to:

Select all the window contents by Right click on the upper frame region, Edit, Select All. SendInput {Enter} to copy its contents to the Clipboard (but maybe someone else knows how to extract the text directly to the Clipboard).

var = Clipboard

Parse the var looking for the line and chars you need.

Good luck

_________________
Regards.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 28th, 2009, 12:59 am 
Offline

Joined: February 7th, 2009, 11:28 pm
Posts: 384
danrevella wrote:
Uhm....
Maybe I have to read a char one pixel at time? :-)))


Actually you probably could do it that way, or just use WinMove to position/size the window the same every time, and then use PixelGetColor to check if a certain area has changed from black to white. If you know the options and where they will appear on the screen, you could do it by having a SetTimer check only one or two pixels every few minutes or so... Maybe RunWait too if that works with console tasks...

Note: I'm not suggesting anyone actually use the pixel method, except as a last resort. I'm sure there are better ways. For example, I've been reading up on the console functions posted by corrupt (see links below) - if you understand how to use them, perhaps they could work - I'm still trying to learn his method.

http://www.autohotkey.com/forum/viewtop ... 87&start=0

http://www.autohotkey.com/forum/viewtopic.php?t=8606

_________________
Hardware: 1.8 GHz laptop with 4 GB ram, Windows XP/SP3
Software: Prevx, Privatefirewall, KeyScrambler.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 30th, 2009, 2:28 pm 
Offline

Joined: March 23rd, 2005, 7:53 am
Posts: 321
Location: Germany
danrevella,

try the following:

1. activate the console window
2. Open its system menu (Alt+Space)
3. Choose Edit
4. Choose Select All
5. Press Enter

Now the text of the console should be in your clipboard.
Maybe step 3+4 are not quite exact as I only have a German Windows and guessed the English names of menu items.
If that works for you it would be easy to tranform it into an AHK script.

_________________
Hasso

Programmers don't die, they GOSUB without RETURN


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 30th, 2009, 5:27 pm 
Offline

Joined: April 24th, 2009, 10:25 pm
Posts: 6
Hasso wrote:
danrevella,

try the following:

1. activate the console window
2. Open its system menu (Alt+Space)
3. Choose Edit
4. Choose Select All
5. Press Enter

Now the text of the console should be in your clipboard.
Maybe step 3+4 are not quite exact as I only have a German Windows and guessed the English names of menu items.
If that works for you it would be easy to tranform it into an AHK script.

yEAH!!
I understand..... unfortunelly while I try to clip the screen, the running program crash...... :-(
Thanks


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: batto, BrandonHotkey, G. Sperotto, Miguel, Mtes, rafaelloureiro, Yahoo [Bot] and 75 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group