title: IApplicationActivationManager::ActivateApplication in C#?
body: <p>I'm working on automated testing for metro apps and I found code to do a lot of what I need, but it's in C++: <a href="http://blogs.msdn.com/b/windowsappdev/archive/2012/09/04/automating-the-testing-of-windows-8-apps.aspx" rel="noreferrer">http://blogs.msdn.com/b/windowsappdev/archive/2012/09/04/automating-the-testing-of-windows-8-apps.aspx</a></p>
  
  <p>My question is, how do I use IApplicationActivationManager::ActivateApplication in C# because I don't know C++?
  Details for the method are found here: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/hh706903(v=vs.85).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/windows/desktop/hh706903(v=vs.85).aspx</a></p>
  
  <p>Here's the code I pulled from Shobjidl.idl:</p>
  
  <pre><code>cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(ACTIVATEOPTIONS)")
  
  // IApplicationActivationManger is used to activate an immersive application identified by its Application User Model Id.
  //
  // Developers who are interested in using the Application Activation Manager do not need to implement the following
  // interface. An implementation is provided through the CoCreatable Object with CLSID_ApplicationActivationManager.
  [
      object,
      uuid(2e941141-7f97-4756-ba1d-9decde894a3d),
      pointer_default(unique)
  ]
  interface IApplicationActivationManager : IUnknown
  {
      // Activates the specified immersive application for the "Launch" contract, passing the provided arguments
      // string into the application.  Callers can obtain the process Id of the application instance fulfilling this contract.
      HRESULT ActivateApplication(
          [in] LPCWSTR appUserModelId,
          [in, unique] LPCWSTR arguments,
          [in] ACTIVATEOPTIONS options,
          [out] DWORD *processId);
      HRESULT ActivateForFile(
          [in] LPCWSTR appUserModelId,
          [in] IShellItemArray *itemArray,
          [in, unique] LPCWSTR verb,
          [out] DWORD *processId);
      HRESULT ActivateForProtocol(
          [in] LPCWSTR appUserModelId,
          [in] IShellItemArray *itemArray,
          [out] DWORD *processId);
  }
  
  
  
  // CLSID_ApplicationActivationManager
      [ uuid(45BA127D-10A8-46EA-8AB7-56EA9078943C) ] coclass ApplicationActivationManager { interface IApplicationActivationManager; }
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Thanks</p>