1 | using System;
|
2 | using System.Runtime.CompilerServices;
|
3 | using System.Runtime.InteropServices;
|
4 |
|
5 | namespace wstool
|
6 | {
|
7 | public enum ActivateOptions
|
8 | {
|
9 |
|
10 | None = 0x00000000,
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | DesignMode = 0x00000001,
|
19 |
|
20 |
|
21 | NoErrorUI = 0x00000002,
|
22 |
|
23 |
|
24 | NoSplashScreen = 0x00000004
|
25 | }
|
26 |
|
27 | [ComImport, Guid("2e941141-7f97-4756-ba1d-9decde894a3d"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
28 | interface IApplicationActivationManager
|
29 | {
|
30 |
|
31 |
|
32 | IntPtr ActivateApplication([In] String appUserModelId, [In] String arguments, [In] ActivateOptions options, [Out] out UInt32 processId);
|
33 | IntPtr ActivateForFile([In] String appUserModelId, [In] IntPtr itemArray, [In] String verb, [Out] out UInt32 processId);
|
34 | IntPtr ActivateForProtocol([In] String appUserModelId, [In] IntPtr itemArray, [Out] out UInt32 processId);
|
35 | }
|
36 |
|
37 | [ComImport, Guid("45BA127D-10A8-46EA-8AB7-56EA9078943C")]
|
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 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 itemArray, [Out] out UInt32 processId);
|
46 | }
|
47 | }
|