Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get list of running MetroStyle apps

I was wondering whether it's possible to get the list of running MetroStyle apps in a C# Metro app or not. I'm looking to do this in Windows 8 (not Windows Phone).

like image 228
Alireza Noori Avatar asked Dec 06 '25 20:12

Alireza Noori


2 Answers

I'm writing an Alt-Tab gesture alternative with Delphi, so this is the way I found to list running ModernUI (once known Metro) applications, I tested it with Windows 8 Release Preview only, I don't know if it still works on 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;

This shows the current running ModernUI application's titles, you can store their HWND however you like.

like image 61
vhanla Avatar answered Dec 08 '25 17:12

vhanla


Not possible. That would be a breach of sandbox. You don't want some random app getting information about the apps you run and reporting it home.

like image 44
Denis Avatar answered Dec 08 '25 18:12

Denis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!