سؤال

I want to make a simple launcher for an application (like, using CreateProcess), that I can use as a HelloWorld app and customize the app tile appearance -- sort of killing two birds at the same time:

  1. Getting familiar with the environment and
  2. Creating tiles who's appearance can be changed (beyond just changing the icon for the app).

However, I'm not sure where to start. I've tried copying this code into the namespace, but this is not working:

[DllImport("coredll.dll")]
private static extern bool CreateProcess(null, "C:\\Program Files (x86)\\Steam\\Steam.exe");

The full code is of course this blank application template for c# ( App.xaml.cs -- at C#, VB, and C++ project templates for Windows Store apps)

هل كانت مفيدة؟

المحلول

Writing Windows Store Apps requires learning new ways of doing common tasks.

For one, Windows Store Application (Metro) are restricted from running other processes. Think of your app as if it is running in a sandbox. You don't have direct access to the underlying system, you need to go through approved channels.

To run apps or open files in Metro you should use a launcher.

To modify the application tiles, you should use the tile API

نصائح أخرى

Rather than call CreateProcess, you should use the Process class. The linked page has an example of creating and running a process. I think you'll find it much easier to use than calling the Windows API directly.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top