There appears to be something wrong with the CursorImage.Assign, if you skip that it does not fault, however is
also does not assign an image....
I dug into my old code and found something using partially the example here posted...
procedure TForm1.Button2Click(Sender: TObject);
Var
C,M:Tbitmap;
I:TIconInfo;
begin
C := TBitmap.Create;
M := TBitmap.Create;
iml.GetBitmap(0, C);
iml.GetBitmap(1,M);
I.fIcon := false;
I.Xhotspot :=0;
I.Yhotspot :=0;
I.hbmColor := C.Handle;
I.hbmMask := M.Handle;
DestroyCursor(Screen.Cursors[crComponent]);
Screen.Cursors[crComponent] := CreateIconIndirect(I);
C.Free;
M.Free;
Screen.Cursor := crComponent;
end;
If you take the example posted here and add another button and drop this code in it, you'll see it works with out
issues in the 32bit windows target, I assume it should also work elsewhere too.
P.S.
I didn't bother to set the mask, I just used the second image for it but it seems to produce what you see..
.