Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default API GetTickCount and API for sound

Hi,

Declare Function GetTickCount& Lib "Kernel32"

The above API function returns the no. of milli seconds since the
sytem was booted.

Can someone provide me a simple code to use the above function to
simulate a stopwatch. Also, in the same code snippet, can you use an
API for sound and any other API's.

This way I will get an idea how to use API's in VB programs.

Thanks in advance.
Prasad Vanka
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default API GetTickCount and API for sound

Prasad,

You can use GetTickCount in the following manner:

Dim StartTicks As Long
Dim EndTicks As Long
StartTicks = GetTickCount()
' more code here
EndTicks = GetTickCount()
MsgBox EndTicks - StartTicks

You can play WAV files with code like the following:

Declare Function sndPlaySound32 Lib "winmm.dll" Alias _
"sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long

Sub PlaySound()
sndPlaySound32 "chimes.wav", 0
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Prasad Vanka" wrote in
message om...
Hi,

Declare Function GetTickCount& Lib "Kernel32"

The above API function returns the no. of milli seconds since

the
sytem was booted.

Can someone provide me a simple code to use the above function

to
simulate a stopwatch. Also, in the same code snippet, can you

use an
API for sound and any other API's.

This way I will get an idea how to use API's in VB programs.

Thanks in advance.
Prasad Vanka



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sound with excel bau Excel Discussion (Misc queries) 0 March 9th 08 11:21 PM
Play sound aac Excel Discussion (Misc queries) 2 December 5th 07 11:24 PM
Sound File Johno Excel Worksheet Functions 6 July 15th 07 04:26 PM
can I add sound to a spreadsheet? add sound to spreadsheet Excel Discussion (Misc queries) 4 February 20th 06 11:08 PM
automatic sound nasira Excel Discussion (Misc queries) 0 February 15th 06 03:54 PM


All times are GMT +1. The time now is 02:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"