UNPKG

2.62 kBPlain TextView Raw
1using System;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5namespace wstool
6{
7 public enum ActivateOptions
8 {
9 // No flags set
10 None = 0x00000000,
11
12 // The application is being activated for design mode, and thus will not be able to
13 // to create an immersive window. Window creation must be done by design tools which
14 // load the necessary components by communicating with a designer-specified service on
15 // the site chain established on the activation manager. The splash screen normally
16 // shown when an application is activated will also not appear. Most activations
17 // will not use this flag.
18 DesignMode = 0x00000001,
19
20 // Do not show an error dialog if the app fails to activate
21 NoErrorUI = 0x00000002,
22
23 // Do not show the splash screen when activating the app
24 NoSplashScreen = 0x00000004
25 }
26
27 [ComImport, Guid("2e941141-7f97-4756-ba1d-9decde894a3d"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
28 interface IApplicationActivationManager
29 {
30 // Activates the specified immersive application for the "Launch" contract, passing the provided arguments
31 // string into the application. Callers can obtain the process Id of the application instance fulfilling this contract.
32 IntPtr ActivateApplication([In] String appUserModelId, [In] String arguments, [In] ActivateOptions options, [Out] out UInt32 processId);
33 IntPtr ActivateForFile([In] String appUserModelId, [In] IntPtr /*IShellItemArray* */ itemArray, [In] String verb, [Out] out UInt32 processId);
34 IntPtr ActivateForProtocol([In] String appUserModelId, [In] IntPtr /* IShellItemArray* */itemArray, [Out] out UInt32 processId);
35 }
36
37 [ComImport, Guid("45BA127D-10A8-46EA-8AB7-56EA9078943C")] // Application Activation Manager
38 class ApplicationActivationManager : IApplicationActivationManager
39 {
40 [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)/*, PreserveSig*/]
41 public extern IntPtr ActivateApplication([In] String appUserModelId, [In] String arguments, [In] ActivateOptions options, [Out] out UInt32 processId);
42 [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
43 public extern IntPtr ActivateForFile([In] String appUserModelId, [In] IntPtr /*IShellItemArray* */ itemArray, [In] String verb, [Out] out UInt32 processId);
44 [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
45 public extern IntPtr ActivateForProtocol([In] String appUserModelId, [In] IntPtr /* IShellItemArray* */itemArray, [Out] out UInt32 processId);
46 }
47}