Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 140
  • Last Modified:

pausing the program.

Is there a way to pause the program and then make it continue say a few seconds later?  For example I want to display an image, then I want to hide it after a number of seconds and continue with the rest of the code.  I understand this is possible using a timer.  Is there any other way in doing this without using a timer?

Thanks!
0
n-generation
Asked:
n-generation
  • 2
  • 2
1 Solution
 
Ryan ChongCommented:
Donno if Sleep API is suit in this condition:

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

Use like:

'Executing code here....

'Pause for 10 seconds

Sleep 10000

'Continue Executing code here....
0
 
n-generationAuthor Commented:
Yea this will do just fine, but can you explain it to me.  What is Kernel32?  Is it just a built in function?
0
 
Ryan ChongCommented:
Basically, we can use API (Application Programming Interface) to do pause program. Kernel32.dll is the core library that every windows platforms have to doing the regular tasks/jobs for windows operation.

And the function Sleep in Kernel32 is one of the function available in Windows, so that means actually we use external function from VB to do 'what VB cant do'.

Hope this is clear
0
 
n-generationAuthor Commented:
Thank you so much! Really good explaination.  And learnt something new today =)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now