|
Hi
We have an automation software which detects Windows built-in control according to their ids.
We noticed that on Windows Vista build 5472, the ids are were totally changed comparing to the ids in Vista beta 2 and earlier.
Is it not correct to rely on the ids? Is there a better way to identify the type of a control (can't it's name change)?
Here is a code sample that we used to list the control ids:
using System; using System.Collections.Generic; using System.Text; using System.Windows.Automation; using System.Reflection;
namespace ConsoleApplication2 { class Program { static void Main(string[] args) { foreach (FieldInfo fi in typeof(ControlType).GetFields()) { ControlType ct = fi.GetValue(new object()) as ControlType; Console.WriteLine(string.Format("id: {0}\tname: {1}", ct.Id, fi.Name)); } Console.Read(); } } } |