/** * Honk 1.5 Plays one or more of the Standard Windows sounds, triggered * purely from the command line. * * use: * * honk * - Plays the default system sound. * * honk SystemStart SystemHand SystemQuestion * - Plays the given list of standard system sounds (usually just one). * * ActivatingDocument * AppGPFFault * BuildComplete * BuildError * BuildWarning * ClipMate5_EmptyClipboard * ClipMate5_Glue * ClipMate5_IgnoreClipboardUpdate * ClipMate5_NewData * ClipMate5_PowerPasteComplete * Close * CriticalBatteryAlarm * EmptyRecycleBin * Incoming-Fax * LowBatteryAlarm * MailBeep * Maximize * MenuCommand * MenuPopup * Minimize * MoveMenuItem * Navigating * Open * Outgoing-Fax * RestoreDown * RestoreUp * RingIn * RingOut * ShowBand * SystemAsterisk * SystemDefault * SystemExclamation * SystemExit * SystemHand * SystemQuestion * SystemStart * SystemWelcome * * You can view the list with regedit. Not all of them are necessarily * hooked up to real sounds. * * These are NOT the same as the names in the control panel or the names * of the *.wav files. * * For more see the registry under: * HKEY_CURRENT_USER/AppEvents/EventLabels. * * or you can specify the names of wav files e.g. * * honk C:\Windows\Media\tada.wav * * Compiled as a Windows console App, without precompiled headers. * For Visual C++ Express options see http://mindprod.com/jgloss/cpp.html#COMPILING * You must add library Winmm.lib to the project properties both debug and release * under additional options to add the lib to the stardand list. * * Honk is much faster than using mplayer or player. Nothing appears on the * screen. It will not hang up if several copies try to play at once. * * Version History: * 1990-01-01 1.2 made library static so don't need separate Borland DLLs. * Compile as a Borland Win32 Owl app with a static library, link no debug, and * OWL libraries with a honk.def file. * 1.3 1998-11-07 embed new Barker address. * 1.4 2008-01-04 convert from Owl to Microsoft * 1.5 2009-03-11 update list of system sounds. */ /* * By Roedy Green, Canadian Mind Products. May be freely * distributed and used for any purpose but military. */ /* Roedy Green Canadian Mind Products #101 - 2536 Wark Street Victoria BC Canada V8T 4G8 tel:(250) 361-9093 http://mindprod.com */ #include #include /* playsound */ #include /* exit, putenv, _splitpath */ #include /* fclose, fgetc, printf, remove, rename, setvbuf */ #include /* strcat, strcmp, strupr */ int main (int argc, char *argv[]); void Banner (void); void Die (void); /** * Main analyses the command line to pick off sound names, and plays them * then exits. There is no user interface. */ int main(int argc , char* argv []) { if ( argc <= 1 ) { Banner(); PlaySound(TEXT("SystemDefault"), NULL, SND_ALIAS|SND_SYNC); } else { // bypass 0, the name of the program for ( int i=1; i