Ejemplo n.º 1
0
        // call back method to capture results
        private static void ResultsReturned(IAsyncResult iar)
        {
            eAudioSettingsDelegate eAudioRunning = (eAudioSettingsDelegate)iar.AsyncState;

            // get the return value from that method call
            bool returnValue = eAudioRunning.EndInvoke(iar);

            if (returnValue)
            {
                RegistryKey eAudioKey = Registry.CurrentUser.OpenSubKey(@"Software\acer\eAudio", true);

                string[] valnames = eAudioKey.GetValueNames();
                Int32    val0     = (Int32)eAudioKey.GetValue(valnames[0]);
                String   value0   = System.Convert.ToString(eAudioKey.GetValue(valnames[0]));
                Int32    val1     = (Int32)eAudioKey.GetValue(valnames[1]);
                String   value1   = System.Convert.ToString(eAudioKey.GetValue(valnames[1]));
                //Int32 val2 = (Int32)eAudioKey.GetValue(valnames[2]);
                //String value2 = System.Convert.ToString(eAudioKey.GetValue(valnames[2]));

                Console.WriteLine(val0);
                Console.WriteLine(val1);

                //Set to default rock EQ.
                eAudioKey.SetValue("EQ", 4);
                eAudioKey.SetValue("AudioMode", 2);

                tray.ShowBalloonTip(1000, "eAudioStartup Manager",
                                    "eAudio is now running EQ reset to Rock...",
                                    ToolTipIcon.Info);

                Thread.Sleep(2000);
            }
            else
            {
                tray.ShowBalloonTip(1000, "eAudioStartup Manager",
                                    "eAudio has not booted...closing",
                                    ToolTipIcon.Info);

                Thread.Sleep(2000);
            }

            tray.Visible = false;
            Application.Exit();
        }