troubleshooting Question

VB6: Sleep, DoEvent, Loop, looking for best way of...

Avatar of C0ding
C0ding asked on
Visual Basic Classic
8 Comments3 Solutions1559 ViewsLast Modified:

I asked this question before, since nobody respond to it,
I decide to ask it again to see if i can get a better results.

What i want to do is something simple, i am working in a VB6 project,
My goal is to execute a command code to a program, but before that
i want my project to wait for that program to be load, then apply code.

Ive been using the Sleep method, and actually is been working very well,
but i was wondering if i could do it better with DoEvent or something better.

Private Sub Form_Load()
Shell "Program-to-be-execute.exe"

Sleep 3 'wait like three seconds or so

Then after the program load up, is time to apply my code here.
I even add a second code to detect if the windows program is ready or not
'f return not ready, then another three seconds are applyed to my project.

End Sub

Thanks in advance

prior related question:
aikimark -- zone advisor

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros