Archived

This topic is now archived and is closed to further replies.

Danny Pellegrene

Easy ? for you...

Recommended Posts

Anyone somewhat familiar with Visual Basic should be able to answer this. I am typing this in my VB program to run a DOS program. x = shell("C:\basic\game.exe", vbnormalfocus) Now, my question is, how can I suspend the execution of my VB program until the DOS program is finished running? I am using VB 6.0 by the way. Thank you very much if you can help me!

Share this post


Link to post
Share on other sites
I don't think there's an easy way to do this... VB (especially VB 6) really doesn't come packaged with support for interacting with other processes... I think you're going to have to learn about using Win32 API with your VB code... It's kind of tricky... maybe try googling for VB API

I don't even know off hand which Win32 functions you'll need, but I don't think there is any other way to find out information about other processes in VB

EDIT:
Once you learn about using Win32 API in your program, I think you'll want to use the FindWindow or the EnumWindows functions which both reside in user32.dll... If none of that made sense to you, it might after doing some research about using API's in VB


TempusElf


[edited by - tempuself on November 14, 2003 7:38:18 PM]

Share this post


Link to post
Share on other sites
Don''t know how it works with VB. But I would start a thread and wait for it until it finishes.
Maybe some words for searching that might help you: thread, mutex and the function WaitForSingleObject.

Hope this helps.

Share this post


Link to post
Share on other sites