gpt4 book ai didi

windows-8 - 获取正在运行的 MetroStyle 应用程序列表

转载 作者:行者123 更新时间:2023-12-01 00:40:46 26 4
gpt4 key购买 nike

我想知道是否可以在 C# Metro 应用程序中获取正在运行的 MetroStyle 应用程序的列表。我希望在 Windows 8(而非 Windows Phone)中执行此操作。

最佳答案

我正在使用 Delphi 编写 Alt-Tab 手势替代方案,所以这是我发现列出正在运行的 ModernUI(曾经为人所知的 Metro)应用程序的方式,我仅使用 Windows 8 Release Preview 对其进行了测试,我不知道是否它仍然适用于 Windows 8 RTM。

procedure ShowRunningModernUIApps;
var
metroapp:hwnd;
strAppTitle: array[0..MAX_PATH]of char;
h:integer;
strListApps:string;
begin
metroapp:=FindWindow('Windows.UI.Core.CoreWindow',nil);
if metroapp <>0 then
begin
GetWindowText(metroapp,strAppTitle,MAX_PATH);
strListApps:='Running ModernUI Apps : '+strAppTitle;
h:=0;
while h=0 do
begin
metroapp:=FindWindowEx(0,metroapp,'Windows.UI.Core.CoreWindow',nil);
if metroapp<>0 then
begin
GetWindowText(metroapp,strAppTitle,MAX_PATH);
strListApps:=strListApps+','+strAppTitle;
end
else h:=1; //let's finish the search loop

end;
end;
ShowMessage(strListApps);

end;

这显示了当前正在运行的 ModernUI 应用程序的标题,您可以根据需要存储它们的 HWND。

关于windows-8 - 获取正在运行的 MetroStyle 应用程序列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11194759/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com