一行代碼去掉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