locked
How to get processes info such as cpu time used in a metro style app using windows runtime api?

    Question

  • Hi,

    I want to develope a metro style app to display the cpu consumption of all processes's  running in the system, but i don't know how to get these info using windows runtime api,  if I inteoperate with Win32 API to get these info in my metro app, can this app throught microsoft's certification?


    • Edited by luoyh Tuesday, April 24, 2012 2:28 AM submit to a wrong forum
    Tuesday, April 24, 2012 2:23 AM

Answers

  • Hi,

    First, there is no way to enumerate processes running in Metro style app because of security considerations.

    EnumProcesses API applies to "desktop app only".

    Second, there is no way to query CPU timing info against a specific process.

    GetProcessTimes API is used to retrieve timing information (i.e. process creation time, exit time, exec  time in kernel mode, exec time in user mode) for the specified process. However, it applies to "desktop app only".

    Metro style app runs in restricted sandbox environment with limited access to some low-level system features. If you have actual needs, you can develop a desktop app.


    Best wishes,


    Robin [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 24, 2012 7:31 AM
    Moderator

All replies

  • Hi,

    First, there is no way to enumerate processes running in Metro style app because of security considerations.

    EnumProcesses API applies to "desktop app only".

    Second, there is no way to query CPU timing info against a specific process.

    GetProcessTimes API is used to retrieve timing information (i.e. process creation time, exit time, exec  time in kernel mode, exec time in user mode) for the specified process. However, it applies to "desktop app only".

    Metro style app runs in restricted sandbox environment with limited access to some low-level system features. If you have actual needs, you can develop a desktop app.


    Best wishes,


    Robin [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 24, 2012 7:31 AM
    Moderator
  • Hi,

    First, there is no way to enumerate processes running in Metro style app because of security considerations.

    EnumProcesses API applies to "desktop app only".

    Second, there is no way to query CPU timing info against a specific process.

    GetProcessTimes API is used to retrieve timing information (i.e. process creation time, exit time, exec  time in kernel mode, exec time in user mode) for the specified process. However, it applies to "desktop app only".

    Metro style app runs in restricted sandbox environment with limited access to some low-level system features. If you have actual needs, you can develop a desktop app.



    Hello,

    this....so does it mean another 3 months of my work for nothing and i have to lay down my work ? Ouch , srsly ...no chance to obtain a list of current running processes ? And no i dont want to sell my idea outside of the Windows app store and just take the old system...because for that i wouldnt had to switch to Metro style and would be fine with win 7 for rest of life...Now i studied programming Metro apps for what 7 months and now i have to search something ( a Project ) which will fit in the store restrictions just to get an advantage out of Metro ? So this basicaly means that we developers have to adopt what we get dictated we can do and what not, wheres the free mind way ...how to produce new breaktrough applications...where to go with creativity ? Does it mean we have to build prude weather and stock apps for the store and be fine with it ? oO

    regards co0Kie

    Thursday, October 4, 2012 9:05 AM