int a = new WindowInteropHelper(this).Handle.ToInt32();// 获得当前窗体的句柄            System.Windows.Controls.Image image1 = new System.Windows.Controls.Image();//定义一个image控件来存放我得到的图标
            IntPtr icon = ExtractIcon(a, @"C:\Windows\System32\imageres.dll", -109);
            Icon i = System.Drawing.Icon.FromHandle(icon);
            Bitmap bitmap = i.ToBitmap();
            IntPtr intPtr = bitmap.GetHbitmap();
            ImageSource imageSource = Imaging.CreateBitmapSourceFromHBitmap(intPtr, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
            image1.Source = imageSource;
            this.grid.Children.Add(image1); [DllImport("shell32.dll")]
        public static extern   IntPtr ExtractIcon(int hInst, string lpszExeFileName, int nIconIndex);现在的问题是,这段代码能够取得win7系统下的 我的电脑 回收站等系统图标 但是在xp系统下则得不到图标,因为xp的注册表里找不到   @"C:\Windows\System32\imageres.dll"  地址 希望各位老鸟大虾能够给出个解决方法,能够同时在xp和win7系统下都能取到系统的图标