"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

When the phone( I have 3 lines) are ringing, I would like to pick up the phone and play music. I know how to play(hardware). All I am looking for is the VB technique to do it.

So, let's say, line 1, line2, and line 3 are ringing.

I would like to pick up line1 and play music, and put the line on hold, and then pick up the line 2 and play music, and put it hold, and so on.( do not worry about the procedure involving put the line on hold - only play music)

My idea is:
1)There will be a tmr running every minute:
2)In my system, there are 2 lists - one contains - ringing lines, and other lines contains hold lines. Tmr will check if any thing in the Ringing list. If it is,
3) Tmr will be off, pick up that line.
4) Play music.
5)Once the music is stopped playing, then I will put the line on hold
6) Then I will go on to the next line.
7) Until there is no line in the ringing list.
8) Tmr will be on again.

I want to makesure that I won't interupt my playing for one line for another one.

I would like to play wav file. Is it a good idea. I would like to play using Winamp, I think it is not bad player..Is it a good choice?

I would like to have code..Only for the Tmr Function.
I know how to handles the lines ( put it on hold, pick up).
ONLY PLAY MUSIC AND WAIT UNTIL MUSIC IS STOPED PLAYED AND THEN MOVE ONTO A NEXT LINE.

sorry it took so long to answer, i just reached home.
looking at your questio though i would suggest you use a mediaplayer control. it can be manupilated easily and getting its palystate, starting, stopping and other such things can be easily accomplished

calling the sndplaysound function with the async parameter makes the function return immediately after beginning the sound whereas using the sync parameter causes the function to return only after palying the entire sound.

try this, since we are calling the function using the SND_ASYNC paramenter the function returns immediately and after the sleep function which pauses the code for 2 seconds, the sound is cut off ( by calling the funciton with no parameter sndPlaySound(0, 0) ).

if we had used SND_ASYNC parameter the sound wouldn't have cut off after 2 seconds since the function wouldn't release control until the whole sound has played