sound question

S

someone watching

XP has sound options for 'device connect' and 'device disconnect'. I like it

especially when it triggers for USB devices. Was wondering if there's any

way to add these options to W2K's sound menu. I'm thinking there might be

because Norton Utilities (which is installed here) has options of its own in

the menu.



anybody?
 
R

Robbie Hatley

"someone watching" wrote:



> XP has sound options for 'device connect' and 'device disconnect'. I like it

> especially when it triggers for USB devices. Was wondering if there's any

> way to add these options to W2K's sound menu. I'm thinking there might be

> because Norton Utilities (which is installed here) has options of its own in

> the menu.






Short answer: No, you can't do that.





Complete answer:



Yes, maybe you can do that, but you'll have to learn Windows

programming (in C, C++, C#, or Visual-Basic) first.



Software can do sounds because it calls Win2K's API funtion "PlaySound"

in the following dll:



C:\WINNT\system32\winmm.dll



You can find the settings in the registry which list which sounds

can be played when certain programs send certain events:



HKEY_Current_User\AppEvents\Schemes\Apps



You can put entries in there to play certain sounds when certain named

events are sent from certain programs. For example, you could say:

- play "dingdong.wav" when program aardvark.exe sends event "Doorbell"

- play "screeech.wav" when program barn_owl.exe sends event "Hoot"



This is organized by user, app, event, and sound scheme, in that order,

so the tree really looks more like:



user1

Schemes

Apps

App1

App1Event1

Scheme1

ding.wav

Scheme2

swish.wav

App1Event2

Scheme1

smash.wav

Scheme2

crunch.wav

user2

Schemes

Apps

App1

App1Event1

Scheme1

snivel.wav

Scheme2

simper.wav

App1Event2

Scheme1

whirr.wav

Scheme2

whine.wav



But to send the events, you'd need access to the source code and compiler

used to make the program, and you'd have to speak the language the program

is written in (C, C++, Visual-Basic, or whatever), and be familiar with the

Win32 API for sending sound events to the OS.



To modify Win2K so that it plays certain sounds for certain hardware events,

you'd have to have the Windows 2000 source code. Bill could give you that...

but then he'd have to kill you. -)



So in short, no, I don't think you can modify Win2K to play certain

sounds when certain events happen, except to the extent that Win2K is

already set-up to play sounds for those events.



But you might be able to write a program that monitors hardware events

such as devices being unplugged, and sends "play sound" messages to

Win2k (via the PlaySound API function) when these hardware events occur.

Unless you're a windows programmer, this isn't going to be easy, though:

1. Get Visual Studio.

2. Get Kernigan's "The C Programming Language" and learn C.

3. Get Petzold's "Programming Windows" and learn Win32 programming.

4. Write a program that monitors hardware events and tells windows

to play certain sounds when certain events occur.



Or, you could do it in Visual Basic. Here's an related article:

http://www.vb6.us/tutorials/playsound-api



As to exactly how to monitor for devices being unplugged, I don't know.

You could try asking in the win32 programming Usenet groups, such as

microsoft.public.win32.programmer



--

Cheers,

Robbie Hatley

lonewolf at well dot com

www dot well dot com slant tilde lonewolf slant
 
R

Robbie Hatley

Brief addendum: one other group to ask in.

I'd recommended to "Someone Watching":



> As to exactly how to monitor for devices being unplugged, I don't know.

> You could try asking in the win32 programming Usenet groups, such as

> microsoft.public.win32.programmer




But on looking in that group, it's not very active. Another group,

this one much more active, where you can ask about Win32 API issues is:



comp.os.ms-windows.programmer.win32



--

Cheers,

Robbie Hatley

lonewolf at well dot com

www dot well dot com slant tilde lonewolf slant
 
S

someone watching

"Robbie Hatley" wrote in message

news:Ms6dneG8V5-nHjjWnZ2dnUVZ_o-dnZ2d@giganews.com...

>

> But to send the events, you'd need access to the source code and compiler

> used to make the program, and you'd have to speak the language the program

> is written in (C, C++, Visual-Basic, or whatever), and be familiar with


the

> Win32 API for sending sound events to the OS.

>

> To modify Win2K so that it plays certain sounds for certain hardware


events,

> you'd have to have the Windows 2000 source code. Bill could give you


that...

> but then he'd have to kill you. -)








> So in short, no, I don't think you can modify Win2K to play certain

> sounds when certain events happen, except to the extent that Win2K is

> already set-up to play sounds for those events.

>


Yea, I kinda figured that when I went looking in the registry and saw sounds

listed for events, but that was it. You explained what I figured ... a call

for sound has to be programmed!



Thanks for the explanation!

BTW, glad you figured what was causing all the headaches with your W2k

setup. I went and reconfigured AGP settings here after reading your post!
 
R

Robbie Hatley

"someone watching" wrote:



> Yea, I kinda figured that when I went looking in the registry and saw sounds

> listed for events, but that was it. You explained what I figured ... a call

> for sound has to be programmed!




I suggest you look and see if any programs of that nature

already exist! Something called "Hardware Event Audible Notifier" or

some such thing. Look around. No sense reinventing a wheel.



That failing, if you have free time, why not make it and sell it for

$20 on tucows? Sure you might have to learn Visual Basic, but what

the heck, it'd improve your resume, and you'd make some ca$h on the side.



> BTW, glad you figured what was causing all the headaches with your W2k

> setup. I went and reconfigured AGP settings here after reading your post!




Well, actually, I didn't. It went down like this:

1. Robbie has problem.

2. Robbie thinks he's finally fixed problem 'cause it worked for 10 days.

3. Robbie comes here and brags about it.

4. An hour later, problem comes back (again) like a cat that won't stay away.



Sigh.



BUT, something interesting happened tonight.... more on that in

separate post.



--

Cheers,

Robbie Hatley

lonewolf at well dot com

www dot well dot com slant tilde lonewolf slant
 
Back
Top Bottom