यहां बताया गया है कि मैंने उस छोटी सी समस्या को कैसे हल किया।
इस सरल वर्ग को अपनी परियोजना में जोड़ें। अब यह मेरे निजी पुस्तकालय का हिस्सा है, लेकिन आप अपनी परियोजना में सीधे कक्षा में जोड़ सकते हैं
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace MyCSharpLibrary
{
public class Volume
{
[DllImport("winmm.dll")]
public static extern int waveOutGetVolume(IntPtr h, out uint dwVolume);
[DllImport("winmm.dll")]
public static extern int waveOutSetVolume(IntPtr h, uint dwVolume);
private static uint _savedVolumeLevel;
private static Boolean VolumeLevelSaved = false;
// ----------------------------------------------------------------------------
public static void On()
{
if (VolumeLevelSaved)
{
waveOutSetVolume(IntPtr.Zero, _savedVolumeLevel);
}
}
// ----------------------------------------------------------------------------
public static void Off()
{
waveOutGetVolume(IntPtr.Zero, out _savedVolumeLevel);
VolumeLevelSaved = true;
waveOutSetVolume(IntPtr.Zero, 0);
}
}
}
अब बुला MessageBox और Volume.On() से पहले Volume.Off() फोन के बाद
Volume.Off();
MessageBox.Show("\n Information \n", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
Volume.On();
मैं पसंद वह दृष्टिकोण क्योंकि मुझे विंडोज़ में संशोधन करने की ज़रूरत नहीं है और मैं अपने संदेश बॉक्स के लिए इच्छित किसी भी आइकन का चयन कर सकता हूं।
आप इस सवाल का वर्ष मैं एक ही समस्या थी लेकिन एक बहुत ही सरल तरीके से इसे ठीक करने में सक्षम था होने के बावजूद धन्यवाद, अलविदा
मेरा मानना है कि व्यक्तिगत संदेश बॉक्स के लिए इसे नियंत्रित करने का कोई तरीका नहीं है; यह एक विंडोज़ सेटिंग है। क्या यह सवाल superuser.com पर है? – dtb
मैं पूछ रहा था कि क्या कोई सी # कोड है जिसे मैं अपने कार्यक्रम के लिए बीप को दूर करने के लिए लिख सकता हूं। मैं सिर्फ अपने सिस्टम के लिए विशिष्ट सेटिंग के लिए नहीं पूछ रहा था। मैं अपने प्रश्न को स्पष्ट करूंगा। आवश्यकता के आधार पर –