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); }
public static extern IntPtr LoadIcon([In] IntPtr hInstance, [In] SystemIcons lpIconName);