0

Quick question ... Microsoft removed support for Process class in Metro Apps. How to get Window title of known Process ID?

I literally Google'd the whole internet for answer without success :/

John Saunders
  • 160,644
  • 26
  • 247
  • 397
schtr4jh
  • 1
  • 2
  • I have edited your title. Please see, "[Should questions include “tags” in their titles?](http://meta.stackexchange.com/questions/19190/)", where the consensus is "no, they should not". – John Saunders Jan 06 '13 at 01:50
  • `Here's actual problem: I'm working on time tracking script. All I have to do is collect data (datetime start, datetime end and process/windows title) and send it to webserver.` - you could do that other ways, here is one example: http://stackoverflow.com/a/12015686/495455. I dont see why you would need to do it via the Process class which uses Win32 API calls? – Jeremy Thompson Jan 06 '13 at 05:23

1 Answers1

1

Microsoft has not supported the Process class in Windows Store apps.

Windows Store Apps are not supposed to have that kind of access, unlike desktop apps. Besides, if you have Windows RT and you're running a Metro App that uses the Process class, you're not going to be able to because Windows RT does not run desktop apps.

Sorry to disappoint you, but if you need to do that, create a desktop app (not able to run on Windows RT).

P.S. They're called Windows Store apps now (not Metro) due to a lawsuit.

Phoenix Logan
  • 1,238
  • 3
  • 19
  • 31
  • 1
    Damn ... So, here's alternative: I can get Window Title if I execute command 'tasklist /fi "PID eq #PID#" /fo "LIST" /v'. But if I couldn't start process, how can I be able to execute command? – schtr4jh Jan 06 '13 at 01:56
  • I'm not sure that's possible... If it's a Windows Store app it **might** be running on Windows RT which does not even use desktop apps which would make this useless anyway, but I don't think you can do that anyway. – Phoenix Logan Jan 06 '13 at 01:58
  • Desktop apps are pretty much only still there for backward compatibility; Microsoft is encouraging people to develop Windows Store apps from now on. They're really going all out with Windows 8. – Phoenix Logan Jan 06 '13 at 02:01
  • Here's actual problem: I'm working on time tracking script. All I have to do is collect data (datetime start, datetime end and process/windows title) and send it to webserver. What you're saying is that the only option is to write Desktop App instead of Win8 App? No problem, because I've just started with developing. =) Thanks for your answer. ;-) – schtr4jh Jan 06 '13 at 02:09
  • No problem, and yes if you wanted to use the Process class you would need a desktop app to do it. – Phoenix Logan Jan 06 '13 at 02:13