c# - Bypassing Windows Forms ClassName name creation to one of my own

走远了吗. 提交于 2019-12-12 02:24:44

问题


I need help to set a Windows Form window classname to one chosen by myself. Didn't find anything useful, so I ask here.

I need this because an old C++ application DLL written by my brother(he has not the code any more) is using FindWindow method with classname to copy data. So i need rename the window class name the same as the old app to get my new app to work.

Any Idea ?


回答1:


Considering this could look as unanswered I found the solution yesterday.

It's not possible to change Window ClassName so I'm ending up using a wrapper invisible window to catch my WMessages.

For completeness the answer to this question was answered by Hans Passant in this post:

winform friendly class name



来源:https://stackoverflow.com/questions/7351148/c-sharp-bypassing-windows-forms-classname-name-creation-to-one-of-my-own

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!