DOS text to PB
DOS text to PB
Is there a way to read text that is displayed in a DOS program window and read it into PB?
I have a DOS program that displays text and I need to capture it as it appears and display it in a PB text window.
I also need to do the reverse.
Any ideas please.
(running PB 3.92 and latest JAPBe)
Thanks
Alan
I have a DOS program that displays text and I need to capture it as it appears and display it in a PB text window.
I also need to do the reverse.
Any ideas please.
(running PB 3.92 and latest JAPBe)
Thanks
Alan
Hi chippy73,
I wanted to redirect ping output to a PB window and found the answer here:
viewtopic.php?t=6544&highlight=ping+dos
Hope that helps.
Regards,
Jim
I wanted to redirect ping output to a PB window and found the answer here:
viewtopic.php?t=6544&highlight=ping+dos
Hope that helps.
Regards,
Jim
Hi Alan,chippy73 wrote:Hello Jim,
Thanks for the link. Had a look. Looks a bit heavy for me to understand but will bear it in mind if no other replies.
regards Alan
To be honest, it's far too heavy for me to grasp too, but it works perfectly. I have sat and played with this code for hours, literally. Most of it is way above my head, but I sort of understand some of it. And that's just because I kept changing bits of the code, trying to work out why it was suddenly broken and reading up on each command.
I don't think there is a way of parsing the output of a DOS command without using the Windoze API.
Which DOS command(s) did you want to use? That code works with other DOS commands, not just ping, so it's worth messing with it. Try some other things. I've had it working with traceroute and ipconfig so far, simply because those are the commands I wanted to use in my PB program.
Regards,
Jim
Hello Jim,
Thanks for your comments.
What I want to do is this:-
I have a DOS program running which displays text in a DOS window. I want to capture this text and display it in a PB window. Same effect as using cut and paste which is not what I want to do.
Maybe there is a way to intercept the text before it reaches the DOS window?
I don't need to capture DOS commands at this time.
Alan
Thanks for your comments.
What I want to do is this:-
I have a DOS program running which displays text in a DOS window. I want to capture this text and display it in a PB window. Same effect as using cut and paste which is not what I want to do.
Maybe there is a way to intercept the text before it reaches the DOS window?
I don't need to capture DOS commands at this time.
Alan
- DoubleDutch
- Addict

- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
- NoahPhense
- Addict

- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
Well, I've spent some time with both routines in the links above. They seems to do similar things.
They work fine with DOS commands etc, and changing it to run my dos program and running both routines I don't get the text displayed in PB, that is displayed in my dos program screen.
Obviously I need to modify the code a bit, but not sure what.
Alan
They work fine with DOS commands etc, and changing it to run my dos program and running both routines I don't get the text displayed in PB, that is displayed in my dos program screen.
Obviously I need to modify the code a bit, but not sure what.
Alan
- DoubleDutch
- Addict

- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
There should be no DOS window opened on the routine I pointed you too, just the PureBasic program - it was in console mode - so it may look like DOS - but it isnt - it could easily be a window or not displayed at all - just processed.
-Anthony
-Anthony
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
Anthony,
Yes I appreciate that and see what you mean.
I think what I need to do is use something like ReadConsole or one of the Console API's that read either the input or output console buffers. Not too sure how to go about this. Any ideas please?
The DOS program is very complex and not written by me. So I am doing a 'fudge' until I can get the source codes and put it into PB properly. It basically reads in from the sound card and performs some very complex functions and then displays it as text in a DOS window.
Alan
Yes I appreciate that and see what you mean.
I think what I need to do is use something like ReadConsole or one of the Console API's that read either the input or output console buffers. Not too sure how to go about this. Any ideas please?
The DOS program is very complex and not written by me. So I am doing a 'fudge' until I can get the source codes and put it into PB properly. It basically reads in from the sound card and performs some very complex functions and then displays it as text in a DOS window.
Alan

