|
-
Feb 7th, 2001, 07:21 AM
#1
Thread Starter
Addicted Member
Hello
Can Any Please Say Me How To Redirect Dos Input and Output To My Form. I Know That This can Be Done, Byt I Dont Know The Exact Procedure.
Can Anyone Please Help Me.
My Email Is : [email protected]
-
Feb 8th, 2001, 11:37 AM
#2
Member
Hmmm.... In all my VB programming years (1.75 years), I`ve always wondered about this... until I finally gave up.
I have found an alternative tho`....
Look up, FileSystemObjects or FileSystemObject (damn! I cant spell right!)
Take a reference to it in your project: Microsoft Scripting Runtime
then you can:
Dim objFolder as Scripting.Folder
Dim objFileSysObj as Scripting.FileSystemObject
Dim objFile as Scripting.File
...these objects are capable of file operations. You will only need to emulate the terminal window of the DOS Command prompt.
as of the present, I have not discovered another way of solving this.... but if ever you do, would you please inform me? I`d really like to know.

email: [email protected]
(You dont have to mail me if this is taking your time.. I dun wanna bother ya`, but if you like, you can mail me)
Hope that helps
Programmers dont byte, they just nibble a bit.
-
Feb 9th, 2001, 07:09 AM
#3
Lively Member
I've only found one way, and it is a really really unstable, and ammature way of doing this...you can get the text in the dos council window by shelling to whatever your running in a Normal window (it can't be fullscreen), and then using sendkeys to press CTRL+C,and get the data out of the clipboard, and vice versa for sending data to it (set the clipboard and then sendkeys CTRL+V)
This can work error free as long as you use API to find the window of the command prompt, and get it's caption, and appactivate that title.
I know this is "BOOTLEG", but oh well
Hope this helps atleast alittle,
Bios
-
Feb 9th, 2001, 09:09 AM
#4
New Member
thanks all
but i thought and still think that there is some trick with the CreateProcess API would do some good.What do you ppl think.
-
Feb 9th, 2001, 09:14 AM
#5
Thread Starter
Addicted Member
Thanks all .
I posted my reply by mistake from prakashkrishna's thread who is my friend.
I think createProcess would work.what do u think
-
Feb 9th, 2001, 02:49 PM
#6
Member
The CreateProcess function creates a new process and its primary thread. The new process executes the specified executable file.
Does this sound like it can work? I dont think so.
It could be another Win32 API ...but definitely not CreateProcess.
Programmers dont byte, they just nibble a bit.
-
Feb 10th, 2001, 03:39 AM
#7
i leave the details to you, since i have no clue if it will work.
Get the standard input and output handles (using the getstdhandle api call) and use writeconsole and readconsole api to read and write data to the dos window open. It SHOULD read and write to and from an open dos window since it is a console text window. I have never tried it however.
-
Feb 11th, 2001, 02:00 AM
#8
Thread Starter
Addicted Member
Thanks,
But I Dont want DoS Window To Open. It Should Be Invisible. But The Input Should Be Provided And The Output should Be Obtained Using Custom Form. I've Seen these In FreeJava(RealJ), Kawa, etc..., though haven't got it myself yet.
-
Feb 14th, 2001, 02:59 AM
#9
Well you could always open the window minimized, then use api to hide it: showwindow(hwnd, sw_hide)
-
Feb 14th, 2001, 06:07 AM
#10
Thread Starter
Addicted Member
Yeah Thanks.
And If It Is Hidden How To Send The Input And Get The Output.
-
Feb 14th, 2001, 07:30 AM
#11
Hyperactive Member
if you go to planet source code, there is a module
somebody wrote in vb that redirects all the output to
your program. StdShellLib or something it's called
but it works great!
Bababooey
Tatatoothy
Mamamonkey
-
Feb 16th, 2001, 03:25 AM
#12
just cuz you can't see it doesnt mean it isnt there. all api calls will still work on it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|