Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

, 获取情景模式与铃音文件

From Wiki
Jump to: navigation, search
Article Metadata

qxiaoyuan 在 23 May 2009 创建
最后由 hamishwillee 在 28 Oct 2011 编辑

一直以来为了读取/设置到用户的情景模式, 短信提示音, 都是很郁闷的使用nokia提供的mr的plugin api和fp1自己的api, 因为不同库, 所以必须发布2个版本, 提交express时浪费了无数的money和精力(维护, 验证, 测试).

后来, 读到子腾大侠的无敌吸星大法, 才知道还有种方法敲开symbian的重重内幕, 今天终于下定决心, 参考子腾大侠的

无敌吸星大法, 解决了这个问题, 比较发现 0x101F8798是CRepository的key, 而0x7e000001是情景模式的index, 短信提示音是mode的一个位移算法, 类似的手机铃音只是下一个值而已, 贴出我的测试代码的核心, 大家一看即知

const char* profile[] = { "biaozhun", "wusheng", "huiyi", "huwai", "xunhuji", "lixian", };
CRepository* cenrep = CRepository::NewLC(TUid::Uid(0x101F8798));
TInt mode = -1;
User::LeaveIfError(cenrep->Get(0x7e000001, mode));
TInt k = mode << 24 | 0x04;
TFileName toneFile;
User::LeaveIfError(cenrep->Get(k, toneFile));
TBuf8<100> pm( (const TUint8*)profile[mode] );
TBuf<512> buf;
CAknInformationNote* informationNote = new ( ELeave ) CAknInformationNote;
informationNote->ExecuteLD( buf );
This page was last modified on 28 October 2011, at 06:03.
189 page views in the last 30 days.