一行代码去掉Devexpress弹窗


使用的是.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
	}
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM