说是破解,实则是去除讨厌的浮动窗,不好意思
PureComponentsTreeView控件我是找很久也没找到正式版,仅有个试用版,在运行时总会在屏幕上显示一个浮动窗体.......
1.启动ILDasm,导入PureComponents.TreeView.DLL
2.使用菜单"文件"―>"转储",将程序的IL代码导出PureComponents.TreeView.il
(包括资源)
3.在资源文件PureComponents.TreeView.LF.resources中看到了和那浮动窗体一样的图片(使用resources Ex,本站下载的),多半是它了
4.用ILDasm打开PureComponents.TreeView.DLL文件,果然,其中名为LF的类有个方法StartThread
5.用文本编辑器打开PureComponents.TreeView.IL文件,找到StartThread方法
// 代码大小 77 (0x4d)
.maxstack 4
IL_0000: ldarg.0
IL_0001: ldfld class [mscorlib]System.Threading.Thread PureComponents.TreeView.LF::m_oThread
IL_0006: brfalse.s IL_0009
IL_0008: ret
IL_0009: ldarg.0
IL_000a: ldc.r8 0.0
IL_0013: call instance void [System.Windows.Forms]System.Windows.Forms.Form::set_Opacity(float64)
IL_0018: ldarg.0
IL_0019: call instance void [System.Windows.Forms]System.Windows.Forms.Control::Show()
IL_001e: ldarg.0
IL_001f: ldarg.0
IL_0020: ldftn instance void PureComponents.TreeView.LF::ShowWorkerThread()
IL_0026: newobj instance void [mscorlib]System.Threading.ThreadStart::.ctor(object,
native int)
IL_002b: newobj instance void [mscorlib]System.Threading.Thread::.ctor(class [mscorlib]System.Threading.ThreadStart)
IL_0030: stfld class [mscorlib]System.Threading.Thread PureComponents.TreeView.LF::m_oThread
IL_0035: ldarg.0
IL_0036: ldfld class [mscorlib]System.Threading.Thread PureComponents.TreeView.LF::m_oThread
IL_003b: ldc.i4.1
IL_003c: callvirt instance void [mscorlib]System.Threading.Thread::set_IsBackground(bool)
IL_0041: ldarg.0
IL_0042: ldfld class [mscorlib]System.Threading.Thread PureComponents.TreeView.LF::m_oThread
IL_0047: callvirt instance void [mscorlib]System.Threading.Thread::Start()
IL_004c: ret
} // end of method LF::StartThread
修改IL_0006: brfalse.s IL_0009为
IL_0006: brtrue.s IL_0009就好了
我曾试着改为IL_0006: ret
IL_0007: ret却不行,还望高人指点
别急着走,还没完,如果就这样在程序中引用的话,VISUAL STUDIO会告诉你强名称方面的错误,再做一点点事就好
在IL文件中找到 .custom instance void [mscorlib]System.Reflection.AssemblyKeyFileAttribute::.ctor(string)
将它以及下面的.permissionset reqmin等等.publickey =等等删除掉
最后生成DLL就可以使用了
ilasm PureComponents.TreeView.il /resource=PureComponents.TreeView.res /DLL
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课