示例#1
0
    public IconEx(SystemIcons sysicon, Size size)
    {
        IntPtr hUser = GetModuleHandle("user32");
        IntPtr hIcon = LoadImage(hUser, (IntPtr)sysicon, IMAGE_ICON, size.Width, size.Height, 0);

        if (hIcon == IntPtr.Zero)
        {
            throw new System.ComponentModel.Win32Exception();
        }
        attach(hIcon);
    }
示例#2
0
 public static extern IntPtr LoadIcon([In] IntPtr hInstance, [In] SystemIcons lpIconName);