API Calls - EXAMPLES needed

  • Thread starter Thread starter jason
  • Start date Start date
J

jason

I've just come accross this:

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

I think this is excellent, it saves on a lot of lines of code (using
Time, Ontime DoEvents etc).Not sure how it works - would like to
understand it more!

Does anyone have any other little gems like this that they use alot
and think are useful.I'm after compact little beuties like the one
above.

If not, does anyone have any links to sites where more info on these
mysterious little calls can be found

Any help greatly appreciated

J.
 
Harald gave you a few pointers.

Always be aware however that APicalls work directly with the operating
system, so KNOWING what they're doing is essential.

If you make a tiny mistake in your APicalls, you're likely to crash your
application if not your system.

The sleep function is quite safe however..
"The Sleep function suspends the execution of the current thread for a
specified interval."


For a good reference on api's there's following FREE utilities,
which I always keep handy:

ApiGuide (i think this is no longer updated, but VERY good as is)
http://www.mentalis.org/agnet/apiguide.shtml
ApiViewer 2003
http://www.activevb.de/rubriken/apiviewer/index-apiviewereng.html


keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
You compare this to Time, Ontime, and doevents, but it doesn't work similar
to any of these - it works similar to wait. You might want to understand
the distinction.
 
Yeah Tom,
I think you're right - I should learn how to do these things with vba
before using this API call
But I've borrowed a loop for flashing before (of the decent sort that
is!) and I was really just commenting that I thought it was cool the
way this call replaces quite a few lines of code

J
 
Back
Top