From e76625eadb1ea7eb954080e5658fa096bf739544 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 3 Jan 2006 01:15:29 +0000 Subject: [PATCH] * fhandler_console.cc (beep): New function. Restores missing "Default Beep", if necessary. (fhandler_console::write_normal): Use beep(). --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/fhandler_console.cc | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e7c1806a1..524ca3579 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2006-01-02 Christopher Faylor + + * fhandler_console.cc (beep): New function. Restores missing "Default + Beep", if necessary. + (fhandler_console::write_normal): Use beep(). + 2006-01-02 Christopher Faylor * dcrt0.cc (_dll_crt0): Move more leftover debugging stuff. 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;