Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » API

Post new topic   Reply to topic
shellexecute
View previous topic :: View next topic  
Author Message
sunil21
Newbie


Joined: 23 Dec 2003
Posts: 8

PostPosted: Dec 23rd, 2003 01:38 PM    Post subject: shellexecute Reply with quote

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
View user's profile Send private message Send e-mail
Andir
Centurion


Joined: 21 Dec 2003
Posts: 184
Location: Chicago Area

PostPosted: Dec 23rd, 2003 01:58 PM    Post subject: Reply with quote

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
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Dec 25th, 2003 05:00 PM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » API All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic