原文:http://www.newlc.com/How-to-Display-the-Uid-of.html
翻譯byLee :http://www.symbianx.cn/viewthread.php?tid=11
如何在S60 3rd的手機上顯示所有已安裝程序的Uid
該程序從S60 2.x 移植到 S60 3.x
S60 2.x的源代碼可以在Forum Nokia 找到,下面的代碼是S60 3.0的。
概要:
以下代碼將顯示手機上安裝的應用程序的Uid,它使用了下面的類。
MAppUidObserver& iObserver;
RArray<TAppInfo> iApps;
class TAppInfo
{
public:
TInt32 iAppUid;
TApaAppCaption iAppCaption;
};
void CAppUidViewerEngine::AppsToUiL()
{
TApaAppInfo apaAppInfo;
TAppInfo appInfo;
iApps.Reset();
// Get info on all apps, then iterate through each app
User::LeaveIfError(iLsSession.GetAllApps());
while(iLsSession.GetNextApp(apaAppInfo) == KErrNone)
{
appInfo.iAppCaption = apaAppInfo.iCaption;
appInfo.iAppUid = apaAppInfo.iUid.iUid;
User::LeaveIfError(iApps.Append(appInfo));
}
// iObserver.AppsFoundL(iApps);
}
以上主要代碼。