how do I get the classname?
-
Hy everyone! I would like to check the classname of my application at runtime, meaning I would like to receive WindowsForms10.Window.8.app87 for example. I am able to fetch this via Spy++ but I have no idea how to fetch this (this string) via C# code. So if anyone of you knew how to fetch this via C# code please let me know. Because I do need this to get access to a running application and do not want to use the name of the window because maybe I will display statusinfos there. Thanks! Stephan.
-
Hy everyone! I would like to check the classname of my application at runtime, meaning I would like to receive WindowsForms10.Window.8.app87 for example. I am able to fetch this via Spy++ but I have no idea how to fetch this (this string) via C# code. So if anyone of you knew how to fetch this via C# code please let me know. Because I do need this to get access to a running application and do not want to use the name of the window because maybe I will display statusinfos there. Thanks! Stephan.
This would work with following solution! Something like that should return your class name: Type myClassType = this.GetType(); string appName = myClassType.Name; // returns Class Name Or you use: string appFullName = myClassType.FullName; // returns Class Name with namespace etc... Hope this is working. With greetings Norman-Timo
-
This would work with following solution! Something like that should return your class name: Type myClassType = this.GetType(); string appName = myClassType.Name; // returns Class Name Or you use: string appFullName = myClassType.FullName; // returns Class Name with namespace etc... Hope this is working. With greetings Norman-Timo
Hy! Sorry, not really! It only displays the selfdefined class! But I do need WindowsForms10.Window.0.app8a for example (that's what spy++ says my classname to be. I just did some debugging and I guess this strange name is created after the run command. WindowsForm because it inherits from WindowsForms and Window because it's a window. But after the run command I am not able to get this anymore. Well I think I have to switch to another solution, maybe I should write the handleID in the registry for the other applications to fetch it. Thanks anyway! Stephan.