Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Metro apps only have a limited subset of classes that are useable, the <code>Process</code> class is one of the removed classes. If a class does not have the windows store icon (<img src="https://i.stack.imgur.com/jJU0t.png" alt="enter image description here">) on the MSDN when you are looking in the <a href="http://msdn.microsoft.com/en-us/library/System.Diagnostics%28v=vs.110%29.aspx" rel="nofollow noreferrer">namespace view</a> then the class is not available for use in metro apps.</p> <p>Metro apps are sandboxed and can not interact with other processes nor spawn new processes themselves so there are no alternatives for running <code>shutdown.exe</code> unless you are willing to make your app a desktop app instead of a metro app.</p> <p>Taking a look at "<a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh464945.aspx" rel="nofollow noreferrer">Alternatives to Windows APIs in Windows Store apps</a>" you can see that there is no metro equivalent to the <code>User: shutdown</code> API either.</p> <p>If you absolutely don't want to create a desktop app but still want to be able to shut down the only other work around I can think of is to have a second program that runs as a system service that your metro app can talk to via some form of <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa365574%28v=vs.85%29.aspx" rel="nofollow noreferrer">IPC</a>. That way you can have your metro app send a request to the service then the service is what will actually initiate the shutdown command.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload