How to get the Class name of a window ?

  • Thread starter Thread starter krishnadevan
  • Start date Start date
K

krishnadevan

Hi friends

How i can get the class name of a window..
My requirment is , I have MDI form that contains many controls..I want to
know the class of each controls in that form at runtime ?

any methods ?

Thanks in advance
Krishnan
 
One option is to use the Win32 API GetClassName(), using PInvoke, on each of
those child controls.

Hi friends

How i can get the class name of a window..
My requirment is , I have MDI form that contains many controls..I want to
know the class of each controls in that form at runtime ?

any methods ?

Thanks in advance
Krishnan
 
I get it..
Ex:
Control c;
c.ToString(); Gave the class name(like System.Windows.Forms.TextBox) to me..
Regards
Krishnan
 
krishnadevan said:
I get it..
Ex:
Control c;
c.ToString(); Gave the class name(like System.Windows.Forms.TextBox) to me..

It's not guaranteed to though. Use GetType() instead to get the type
reliably.
 
Back
Top