我有一個WPF應用程序,它使用導航窗口和框架在xaml頁面之間導航。每次它在頁面之間發出咔嗒聲。有沒有辦法禁用?NavigationWindow點擊聲音
到目前爲止,我已經試過這樣:
namespace FrameTesting
{
public partial class MainWindow : NavigationWindow
{
private const int FEATURE_DISABLE_NAVIGATION_SOUNDS = 21;
private const int SET_FEATURE_ON_THREAD = 0x00000001;
private const int SET_FEATURE_ON_PROCESS = 0x00000002;
private const int SET_FEATURE_IN_REGISTRY = 0x00000004;
private const int SET_FEATURE_ON_THREAD_LOCALMACHINE = 0x00000008;
private const int SET_FEATURE_ON_THREAD_INTRANET = 0x00000010;
private const int SET_FEATURE_ON_THREAD_TRUSTED = 0x00000020;
private const int SET_FEATURE_ON_THREAD_INTERNET = 0x00000040;
private const int SET_FEATURE_ON_THREAD_RESTRICTED = 0x00000080;
public MainWindow()
{
int feature = FEATURE_DISABLE_NAVIGATION_SOUNDS;
CoInternetSetFeatureEnabled(feature, SET_FEATURE_ON_PROCESS, true);
InitializeComponent();
}
[DllImport("urlmon.dll")]
[PreserveSig]
[return: MarshalAs(UnmanagedType.Error)]
static extern int CoInternetSetFeatureEnabled(
int FeatureEntry,
[MarshalAs(UnmanagedType.U4)] int dwFlags,
bool fEnable);
}
}
你工作的這一個,羅伯特?我無法使用IE10在Win7 x64上運行。 – 2013-09-17 00:55:01
我從來沒有得到這個工作。我最終放棄了使用導航窗口的想法,並在頁面之間導航時僅使用數據模板設置了內容區域。 – Robert 2013-09-17 22:11:19