IHxInteractiveUser启动exe

版权声明:本人的作品仅供研究目的,如果读者利用本人的作品从事其他行为,与本人无关 https://blog.csdn.net/oShuangYue12/article/details/81457987
using HelpPane;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace TestHelpPanel
{


    [Guid("8CEC595B-07A1-11D9-B15E-000D56BFE6EE")]
    [TypeLibType(TypeLibTypeFlags.FHidden | TypeLibTypeFlags.FOleAutomation)]
    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    [ComImport]
    public interface IHxInteractiveUser
    {
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
        void Execute([MarshalAs(UnmanagedType.LPWStr), In] string pcUrl);
    }
    class Program
    {
        static void Main(string[] args)
        {


            Type tp = Type.GetTypeFromCLSID(new Guid("8CEC58E7-07A1-11D9-B15E-000D56BFE6EE"));
            IHxInteractiveUser pn = Activator.CreateInstance(tp) as IHxInteractiveUser;
            string file = "file:///C:/Windows/system32/calc.exe";
            pn.Execute(file);


        }
    }
}

猜你喜欢

转载自blog.csdn.net/oShuangYue12/article/details/81457987
今日推荐