Solved

Sleep the Process

Posted on 2001-06-07
9
1,244 Views
Last Modified: 2007-11-27
How can i stop the process for some seconds in  VB6.0 ?  
0
Comment
Question by:vinaikk
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 4

Expert Comment

by:joachimc
ID: 6162920
Sleep(5000)

to sleep in 5 secs..

/Joachim
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 6162937
use the sleep api, call it like this...

call sleep(5000) '1000 = 1 second
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 6162941
Hi, to use Sleep(n) , n = miliseconds. You need to add this API first:

Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

Sleep 3000 ' = 3 seconds

OR

You can create a For Loop like this:

dim n as long
For i = 1 to n
     Doevents 'Let Windows handles other processes.
Next i


'Hope will help.
0
 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 5 total points
ID: 6162943
LOL, when i read the question there was no comments, i went to the bathroom came back and commented and your comment was there...


0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 49

Expert Comment

by:Ryan Chong
ID: 6162947
Correct my codes:

dim n as long

n = 30000

For i = 1 to n
    Doevents 'Let Windows handles other processes.
Next i


0
 

Author Comment

by:vinaikk
ID: 6163238
This is too good thanks a ton !!!
0
 
LVL 4

Expert Comment

by:joachimc
ID: 6163381
Get out of here. Give the points to the right answer.
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 6163865
joahimc, I did not ask for the points...sorry about that...the reason i left that comment saying that i dident know your post was there i when i posted is because i loaded it and then when to the bathroom came back and posted as you can see my post is 2 min after yours...I dont want the points for it but i dont think there is anyway he can take them back and give them to you...but i do agree you deserve them...

Brian
0
 
LVL 4

Expert Comment

by:joachimc
ID: 6163877
Not your fault he should know who to choose by himself shouldn't he :)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now