Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows mobile 更改windows phone 6配置文件[正常、静音、振动]在主屏幕上不生效?_Windows Mobile_Compact Framework_Windows Mobile 6 - Fatal编程技术网

Windows mobile 更改windows phone 6配置文件[正常、静音、振动]在主屏幕上不生效?

Windows mobile 更改windows phone 6配置文件[正常、静音、振动]在主屏幕上不生效?,windows-mobile,compact-framework,windows-mobile-6,Windows Mobile,Compact Framework,Windows Mobile 6,我有一个问题,我需要将我的应用程序的手机配置文件切换到静音[正常,振动,静音,自动,响亮] 所以我找到了这样修改“ActiveProfile”注册表项的解决方案 RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("ControlPanel\\Profiles", true); registryKey.SetValue("ActiveProfile", "Silent"); registryKey.Flush(); registry

我有一个问题,我需要将我的应用程序的手机配置文件切换到静音[正常,振动,静音,自动,响亮]

所以我找到了这样修改“ActiveProfile”注册表项的解决方案

RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("ControlPanel\\Profiles", true);
registryKey.SetValue("ActiveProfile", "Silent");
registryKey.Flush();
registryKey.Close();
Registry.CurrentUser.Flush();



PhoneSoundState.SNDFILEINFO sNDFILEINFO = default(PhoneSoundState.SNDFILEINFO);
sNDFILEINFO.sstType = PhoneSoundState.SND_SOUNDTYPE.None;
PhoneSoundState.SndSetSound(PhoneSoundState.SND_EVENT.All, ref sNDFILEINFO, true);


int HWND_BROADCAST = 0xffff;
int WM_WININICHANGE = 0x001A;

SendMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
当我进入设置->配置文件时,代码100%工作。我发现档案被换了 但当进入主屏幕时,它就像钢一样[正常] 重新启动手机时发生的事件,未刷新到新值[无提示]

下面是关于执行代码后的演示。图像:

[背景]

[在主屏幕中]


因此,我错过了要做的事情,并感谢您

注册表中可能还有更多更改。我使用s-k工具(免费软件)提供的ssnap进行此类确定性分析。只需在手动更改配置文件之前运行ssnap,并在更改后创建第二个快照。然后比较两个快照以找出差异。在最坏的情况下,设置是从特殊位置(即NVRAM、无线电模块或SIM卡)写入和读取的,并在每次启动时反映到注册表。如果是这样,你就迷路了。注册表项不是标准的MS Window Mobile注册表项(未记录),可能与OEM有关。谢谢。是的,就是这样。我找到了另一个需要更改的注册表项,它可以正常工作