예제 #1
0
        internal static BitmapSource GetImage(NativeStockIcon icon, NativeStockIconOptions options)
        {
            options |= NativeStockIconOptions.Handle;

            StockIconInfo info = new StockIconInfo();
            info.StructureSize = (uint) Marshal.SizeOf (typeof (StockIconInfo));

            int hresult = SHGetStockIconInfo (icon, options, ref info);
            if (hresult < 0)
                throw new COMException ("SHGetStockIconInfo failed", hresult);

            BitmapSource bitmap;
            try {
                bitmap = Imaging.CreateBitmapSourceFromHIcon (info.Handle, Int32Rect.Empty, null);
            }
            finally {
                DestroyIcon (info.Handle);
            }

            return bitmap;
        }
 internal static extern int SHGetStockIconInfo(StockIconIdentifier identifier, StockIconOptions flags, ref StockIconInfo info);
        internal static IntPtr GetIcon(StockIconIdentifier identifier, StockIconOptions flags)
        {
            StockIconInfo info = new StockIconInfo();
            info.StuctureSize = (UInt32)Marshal.SizeOf(typeof(StockIconInfo));

            int hResult = SHGetStockIconInfo(identifier, flags, ref info);

            if (hResult < 0)
                throw new COMException("SHGetStockIconInfo execution failure", hResult);

            return info.Handle;
        }
예제 #4
0
        static extern int SHGetStockIconInfo(NativeStockIcon icon, NativeStockIconOptions options,
		                                               ref StockIconInfo info);
예제 #5
0
            public static string GetIcon(int identifier)
            {
                StockIconInfo info = new StockIconInfo();
                info.StuctureSize = (UInt32)System.Runtime.InteropServices.Marshal.SizeOf(typeof(StockIconInfo));

                int hResult = SHGetStockIconInfo(identifier, 0, ref info);

                if (hResult != 0)
                    throw new System.ComponentModel.Win32Exception("SHGetStockIconInfo execution failure " + hResult.ToString());

                return info.Path + "," + info.Identifier;
            }
예제 #6
0
 private static extern int SHGetStockIconInfo(
     int identifier,
     int flags,
     ref StockIconInfo info);
예제 #7
0
 internal static extern HResult SHGetStockIconInfo(
     StockIconIdentifier identifier,
     StockIconOptions flags,
     ref StockIconInfo info);
예제 #8
0
 private static extern IntPtr SHGetStockIconInfo(
     StockIconId siid,               // 取得するアイコンの IDを指定する StockIconId enum 型
     StockIconFlags uFlags,          // 取得するアイコンの種類を指定する StockIconFlags enum 型
     ref StockIconInfo psii          //(戻り値)StockIconInfo 型
     );
예제 #9
0
 static extern int SHGetStockIconInfo(NativeStockIcon icon, NativeStockIconOptions options,
                                      ref StockIconInfo info);
예제 #10
0
 internal static extern int SHGetStockIconInfo(uint siid, uint uFlags, ref StockIconInfo psii);
예제 #11
0
 public static extern HResult SHGetStockIconInfo(
     StockIconIdentifier identifier,
     StockIconOptions flags,
     ref StockIconInfo info);