CreateIconFromResource function user32

Win32Result<HICON> CreateIconFromResource(
  1. Pointer<Uint8> presbits,
  2. int dwResSize,
  3. bool fIcon,
  4. int dwVer,
)

Creates an icon or cursor from resource bits describing the icon.

To learn more, see learn.microsoft.com/windows/win32/api/winuser/nf-winuser-createiconfromresource.

Implementation

Win32Result<HICON> CreateIconFromResource(
  Pointer<Uint8> presbits,
  int dwResSize,
  bool fIcon,
  int dwVer,
) {
  final result_ = CreateIconFromResource_Wrapper(
    presbits,
    dwResSize,
    fIcon ? TRUE : FALSE,
    dwVer,
  );
  return .new(value: .new(result_.value.ptr), error: result_.error);
}