首页 > 其他 > 详细

一行代码去掉Devexpress弹窗

时间:2020-01-22 19:03:17      阅读:192      评论:0      收藏:0      [点我收藏+]

使用的是.net hook方法:
使用代码:

using System;
using System.Windows.Forms;

namespace AlexDevexpressToolTest
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Alex.DevexpressTools.Hit.Init();
            Application.Run(new Form1());
        }
    }
}

工具方法:

using DotNetDetour;

namespace Alex.DevexpressTools
{
    public class Hit
    {
        public static void Init()
        {
            MethodHook.Install();
        }
    }

    public class Utils : IMethodHook
    {
        #region 去掉弹窗
        [HookMethod("DevExpress.Utils.About.Utility", null, null)]
        public static bool ShouldShowAbout()
        {
            return false;
        }
        
        [OriginalMethod]
        public static bool ShouldShowAbout_Original()
        {
            return false;
        }
        #endregion
    }
}

一行代码去掉Devexpress弹窗

原文:https://www.cnblogs.com/AlexanderZhao/p/12229221.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!