| View previous topic :: View next topic |
| Author |
Message |
sunil21 Newbie
Joined: 23 Dec 2003 Posts: 8
|
Posted: Dec 23rd, 2003 01:38 PM Post subject: shellexecute |
|
|
is it possible for me to run an appllcation in vb using shellexecute
function and control it fully.
what i mean is to start something like checkdisk using this function. i need full control of that program as well as the outputs to the vb |
|
| Back to top |
|
Andir Centurion

Joined: 21 Dec 2003 Posts: 184 Location: Chicago Area
|
Posted: Dec 23rd, 2003 01:58 PM Post subject: |
|
|
unfortunately, no...but...
It will return the program's handle. I'm sure this ID can be used with one of the API's to send messages to the application, but then it gets fun. I've not played around with the SendMessage API, so I'm not sure what exactly you'll be able to do. :huh: Check out this article on SendMessage
As far as getting a return form the program, you won't get that through shell either. You could always try to pipe it to a file and open that file in VB:
| Code: |
exString = "myprog.exe > output.txt"
|
This would require that the program return something to the command prompt. (ie: the DIR command, when piped to a text file, will dump the directory listing to that file. "C:\DIR > text.txt")
Hope this helps a little. _________________ If you happen to see little people sitting on your desk...don't tell anyone or they might think your crazy too. |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Dec 25th, 2003 05:00 PM Post subject: |
|
|
The sendmessage API can allow you to send click messages and key stroke messages to controls in a program. So you can always start it, use the [api]FindWindow[/api] and [api]FindWindowEx[/api] APIs to get handles of command buttons and stuff like that and then send messages (sendmessage) but I can't think of a way to direct the output... Do you want specifically checkdisk or general control of any given program? _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
|