• 0

List of Only Metro Windows Titles .Net


Question

I am writing a program and I need to get a list of open Metro apps. I posted a clear explanation on StackOverflow (reproduced below), but didn't get much of a response. For more on what I am working on see here.

 

Background

I am working on a program that needs to find a list of open Metro apps. I originally tried using pure python with ctypes and using win32 api. Unfortunately, I couldn't get the names of Metro apps. So I moved on to IronPython thinking I could leverage a .net function or two to get what I want. No luck.

Where I am at

I can easily get a list of running processes and their PID, but filtering the Metro apps from the non-metro apps is proving near impossible. Also, I need to get the HWND of that window so I can interact with it.

What Won't Work

EnumWindows doesn't seem to work. FindWindowEx seems promising, but I am not sure how to do this.

 

What I want

An example or lead on how to get the list of titles. Preferably in a .net language.

 

 

Thanks for any help you can give!

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

I will try the ImmersiveProcess. That looks promising. The other link was informative, thanks!

Link to comment
Share on other sites

  • 0

Whilst you might be able to find what apps are Metro apps, I doubt you'll be able to actually interact with them in any meaningful way. Metro apps are all sandboxed in separate AppContainers and the security model won't let you interact with them.

Link to comment
Share on other sites

  • 0

 

FloatingFatMan, on 25 Mar 2015 - 03:35, said:

    Whilst you might be able to find what apps are Metro apps, I doubt you'll be able to actually interact with them in any meaningful way. Metro apps are all sandboxed in separate AppContainers and the security model won't let you interact with them.

Good to know, I do however know that what I am attempting is possible, as 3+ different developers created the same thing independently. (StartMenuModifier is one).

I am now having difficulty getting from a C# process handle to a C++ pointer. I am currently trying to call process.Handle, but that is an IntPtr, and IsImmersiveProcess takes C pointers. I tried .ToPointer, but that just gave me the error "TypeError: expected pointer, got Pointer" :rofl:  I think that the "Pointer" is a C# pointer and a "pointer" is a C++ pointer, but I do not understand how I am supposed to get from one to the other. :cry: I'll probably try to use a winapi through ctypes next. Thanks!

 

Link to comment
Share on other sites

  • 0

It's not a pointer, it's a handle, which is just an IntPtr in C#. Your P/Invoke signature should be something like (untested):

[DllImport("User32.dll")]
public static extern bool IsImmersiveProcess(IntPtr hProcess);
Link to comment
Share on other sites

This topic is now closed to further replies.