Free MS Windows替换操作系统ReactOS刚刚发布了新版本.他们拥有一支庞大而活跃的开发团队.
我一直在尝试从桌面应用程序获取系统上安装的所有 UWP 应用程序的显示名称(应用程序的用户友好名称)。我正在尝试使用SHLoadIndirectString()
从与这些应用程序相对应的注册表项获取的资源字符串。让我们以 Windows 计算器为例。
SHLoadIndirectString() 用法
\n\nHKEY_CLASSES_ROOT\\Local Settings\\Software\\Microsoft\\Windows\\CurrentVersion\\AppModel\\\xe2\x80\x8c\xe2\x80\x8bRepository\\Packages\\\xe2\x80\x8c\xe2\x80\x8bMicrosoft.WindowsCal\xe2\x80\x8c\xe2\x80\x8bculator_10.1705.1301\xe2\x80\x8c\xe2\x80\x8b.0_x64__8wekyb3d8bbw\xe2\x80\x8c\xe2\x80\x8be\\DisplayName
它的资源字符串可以从注册表项中获取。\n我的系统上它的资源字符串是@{Microsoft.WindowsCalculator_10.1705.1301.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.WindowsCalculator/Resources/AppStoreName}
为了获得显示名称,我会这样做SHLoadIndirectString(@{Microsoft.WindowsCalculator_10.1705.1301.0_x64__8wekyb3d8bbwe?ms-resource://Microsoft.WindowsCalculator/Resources/AppStoreName})
。
实验观察
\n\nSHLoadIndirectString()
两个不同的用户(U1和U2)。U1 的语言设置为英语,U2 的语言设置为法语 (FR-fr)。当从 U1 运行 SHLoadIndirectString() 时,它返回Windows Calculator
,对于 U2 我得到Calculatrice Windows
。因此,同一资源字符串的返回值取决于当前用户的语言设置。(resources.pri)
资源字符串时,我在U1中没有收到错误。之前的资源字符串是@{DJiT.edjing-DJmixerconsolestudio-PlayMixRecordShar_5.1.12.0_x64__3nf5xjt6s13jt?ms-resource://DJiT.edjing-DJmixerconsolestudio-PlayMixRecordShar/Resources/AppName}
,我后来在@{C:\\\\Program Files\\\\WindowsApps\\\\DJiT.edjing-DJmixerconsolestudio-PlayMixRecordShar_5.1.12.0_x64__3nf5xjt6s13jt\\\\resources.pri?ms-resource://DJiT.edjing-DJmixerconsolestudio-PlayMixRecordShar/Resources/AppName}
传递给 之前SHLoadIndirectString()
。寻找解决方案
\n\nShell environment or ResourceContext
,但没有给出每个值的详细信息。