As my previous post (see the following code on C# again), I overcome the
problem of converting IntPtr to RuntimeTypeHandle (it's RuntimeTypeHandle.
not hwnd, and now, that I have the handle of that class - It make scenes,
because when I get its class name, by WinAPI: GetClassNameW, I get the class
name I expected).
I have the control's handle (the following code, get a hwnd as IntPtr input
parameter).
The code uses reflection, but what I have found nothing special - only one
property (maybe, by mistake, or something default : size, that has the
length of 4).
As I stated on previous post, I think a control doesn't necessarily expose
all of its properties - but when it does?
What should be necessary that I can use reflection to a specific control?
(The goal is - There is a 3rd-party class, I don't know nothing about it,
but I need to change some of it's elements).
public static bool WindowEnumProc(IntPtr hwnd, int lParam)
{
RuntimeTypeHandle hh;
Type t;
PropertyInfo[] pi;
object o;
hh = Type.GetTypeHandle(hwnd);
t = Type.GetTypeFromHandle(hh);
pi = t.GetProperties();
for (int i = 0; i < pi.Length; i++)
{
propName = pi.ElementAt(i).Name;
MessageBox.Show(propName, "property name");
p = t.GetProperty(propName);
o = p.GetValue(hwnd, null);
MessageBox.Show(text + ".." + propName + ".." + o.ToString(),
"property");
}
}
// there is only one property exposed (for my case is: Size, and always =
4).
// For my concusion for now, a control doesn't necessaraly expose all of
it's child controls or properties ...
"Marcel Müller" wrote in message
news:4fbe6795$0$9505$9b4e...@newsspool1.arcor-online.net...