How standard control class names are generated in VS2005

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

How the class name for windows standard controls(Ex:Button) are generated
in VS2005?
InVS 2005, I have created one button conrol and compiled. I got a class name
as given below:

"WindowsForms10.BUTTON.app.0.14fd2b5"

The last portion of the above class string "app.0.14fd2b5" is keep changing
for each applications.
Can any one clarify me that How it is getting changed? IS there any way to
get a fixed string?

Also in VS2003, the class name for the abov control is
""WindowsForms10.BUTTON.app3"
Now ,the class format got changed in VS2005. Why it is so?

Please can any one help me to understand the logic behind.

Thanks,
Mohan
 
Can any one clarify me that How it is getting changed? IS there any way to
get a fixed string?

Winforms registers a window superclass with a slightly mangled name
for every native window class you use. The name differs between
appdomains because they are supposed to be isolated.


Mattias
 
Thanks for your clarification Mattias. Still I have some more questions.
Why this class name (format) is changed from VS2003? Will it be changed for
compiling application on each time? For some applications,in VS2003, the
class name is not changed for each build. Particularly the last portion of
the class string("app3").

I am using some WIN32 APIs in my projecty for idendifying some controls.
For that I will have to pass class name as one of the parameter. I would like
that the method should be generic for both VS2003 and VS2005. For each
version ,I dont want to change the class name. Is there any generic way to
handle this issue?
 
Why this class name (format) is changed from VS2003? Will it be changed for
compiling application on each time? For some applications,in VS2003, the
class name is not changed for each build.

The class name isn't set at compile time, and VS has nothingto do with
it. The Windows Forms assembly handles the naming at runtime.

I don't know why it changed. But I consider it to be an implementation
detail that I shouldn't care about or rely on.

I am using some WIN32 APIs in my projecty for idendifying some controls.
For that I will have to pass class name as one of the parameter. I would like
that the method should be generic for both VS2003 and VS2005. For each
version ,I dont want to change the class name. Is there any generic way to
handle this issue?

Can't you look up the class name from the window handle (with the
GetClassName function)?


Mattias
 
Thanks again. I am trying to identify the controls in some third party
applications by using the control name and class name. To get the handle of
the control, I am using Classname as one parameter to make sure the
appropriate controls.
Because some of the controls wont be having unique name in some
applications.
For eample in some applications Edit and push button will be having the same
name. Unless I use class name ,I cannot get the handle of the appropriate
controls.
 
Back
Top