Ejemplo n.º 1
0
        private static IntPtr GetIcon(ShellApi.StockIconIdentifier identifier, ShellApi.StockIconOptions flags)
        {
            var info = new ShellApi.StockIconInfo
            {
                StuctureSize = (UInt32)Marshal.SizeOf(typeof(ShellApi.StockIconInfo))
            };
            var hResult = Shell32.SHGetStockIconInfo(identifier, flags, ref info);

            if (hResult < 0)
            {
                throw new COMException("SHGetStockIconInfo execution failure", hResult);
            }
            return(info.Handle);
        }
Ejemplo n.º 2
0
 internal static extern int SHGetStockIconInfo(ShellApi.StockIconIdentifier identifier,
                                               ShellApi.StockIconOptions flags, ref ShellApi.StockIconInfo info);