WinForm的友好类名 [英] winform friendly class name

查看:177
本文介绍了WinForm的友好类名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C#WinForm的应用程序,它使用的间谍++时,给出了WindowsForms10.Window.8.app.0.33c0d9d作为类名。
是有没有办法改变的东西更友好?

I have a c# winform application that when used spy++, gives "WindowsForms10.Window.8.app.0.33c0d9d" as class name. Is there a way to change that to something more friendly?

推荐答案

有没有。最后一个十六进制数是拥有该窗口的应用程序域的哈希码。在此之前,该数字从0开始,但如果其他窗口用相同的类名创建增加。在此之前的数字是该类风格的价值。显然,你只能猜测这个名字,如果正确你有变量,其价值仅仅是进程内访问的内幕知识。

There isn't. The last hex number is the hash code of the AppDomain that owns the window. The digit before that starts at 0 but increases if other windows were created with the same class name. The number before that is the value of the class style. Clearly you can only guess this name correctly if you have insider knowledge of variables whose value is only accessible inside the process.

也可以改变它。你会重写窗口的CreateParams属性,但设置className属性将Windows窗体查找与该名称的现有窗口类。而无法找到它,轰炸你的程序。

Nor can you change it. You'd override the window's CreateParams property but setting the ClassName property will make Windows Forms look for an existing window class with that name. And fail to find it, bombing your program.

也不能覆盖它。逻辑内置于NativeWindow类的私有方法。显然,这不是设计,使其易于使用FindWindowEx()。

Nor can you override it. The logic is built into a private method of the NativeWindow class. Clearly this was not designed to make it easy to use FindWindowEx().

只要改变源代码是一个选项,有设置一个跨更好的办法除了使用Windows消息-Process通信。命名管道,插座,远程处理,WCF。

As long as changing the source code is an option, there are far better ways to setup an inter-process communication beyond using Windows messages. Named pipes, sockets, Remoting, WCF.

这篇关于WinForm的友好类名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆