Results 1 to 5 of 5

Thread: Is there a way to make a program wait without a timer?

  1. #1

    Thread Starter
    Addicted Member NewGen's Avatar
    Join Date
    Nov 2002
    Location
    olathe, ks
    Posts
    152

    Is there a way to make a program wait without a timer?

    I am adding a function to my scripting language so that the program will wait . . . Is there a function call or maybe some API to make a program stop execution for a certain amount of time?
    I suck with graphics. Can you help me out? If you are good with graphics there are rewards . . . email me, [email protected] . . .

    [img src="www.cel-eration.com/anim1.gif"][/img]

  2. #2
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236
    Yes the Sleep API.

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

    Sleep 1000 'Delay or wait for 1 second

  3. #3
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    theres another api call, bit more code needed, which allows events to happen whilst in sleep, such as use the min button etc.. i cant remember the name but somebody in here will surely know.

  4. #4
    Frenzied Member Ideas Man's Avatar
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    1,718
    Try this that MartinLiss posted, works quite well.

    http://www.vbforums.com/showthread.p...ferrerid=35425
    I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)

  5. #5
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    703
    If you need to be woken on a certain condition, WaitForSingleObject/WaitForMultipleObjects is useful.
    an ending

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width