diff options
author | Christopher Faylor <me@cgf.cx> | 2006-01-03 01:15:29 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-01-03 01:15:29 +0000 |
commit | e76625eadb1ea7eb954080e5658fa096bf739544 (patch) | |
tree | 9debe42387701699a5b32772dd7227d6d53cfb36 /winsup/cygwin/fhandler_console.cc | |
parent | 1529831639b2fba67f871b34eeed2d35fa6bede7 (diff) | |
download | cygnal-e76625eadb1ea7eb954080e5658fa096bf739544.tar.gz cygnal-e76625eadb1ea7eb954080e5658fa096bf739544.tar.bz2 cygnal-e76625eadb1ea7eb954080e5658fa096bf739544.zip |
* fhandler_console.cc (beep): New function. Restores missing "Default Beep",
if necessary.
(fhandler_console::write_normal): Use beep().
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 3fd139deb..3370564c2 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -29,6 +29,7 @@ details. */ #include "pinfo.h" #include "shared_info.h" #include "cygtls.h" +#include "registry.h" #define CONVERT_LIMIT 16384 @@ -1412,6 +1413,17 @@ bad_escape: } } +static void +beep () +{ + char buf[4096]; + reg_key r (HKEY_CURRENT_USER, KEY_ALL_ACCESS, "AppEvents", "Schemes", "Apps", + ".Default", ".Default", ".current", NULL); + if (r.get_string ("", buf, sizeof (buf), "") != 0) + r.set_string ("", "Windows XP Ding.wav"); + MessageBeep (0xFFFFFFFF); +} + const unsigned char * fhandler_console::write_normal (const unsigned char *src, const unsigned char *end) @@ -1470,7 +1482,7 @@ fhandler_console::write_normal (const unsigned char *src, switch (base_chars[*src]) { case BEL: - MessageBeep (0xFFFFFFFF); + beep (); break; case ESC: dev_state->state_ = gotesc; |