Custom cursors lazarus / 31-LCL ---------------------------------------------------------------------- simsee · 2024-02-05 15:49 I'm writing a component that needs some custom mouse cursors. I read some old posts on the subject and also studied the example present in the Lazarus installation folders, but something is not clear to me. Assuming that the custom cursor file is called pencil.cur, using the lazres utility, I construct the resource file as follows C:\Users\216068\Desktop\res>lazres cursors.res pencil.cur pencil.cur ResourceName='pencil' Type=RT_GROUP_CURSOR At this point in the unit relating to the main form of my application I add the following initialization section (see attachment for the complete project): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i implementation {$R *.lfm}//{$R *cursors.res} { TForm1 } initialization  Screen.Cursors[1]:=LoadCursorFromLazarusResource('pencil');  Screen.Cursor:=1;end. Unfortunately the program it does not work, failing to find the cursor resource. What did I do wrong? Thanks in advance. ---------------------------------------------------------------------- KodeZwerg · 2024-02-05 16:24 \lazarus\examples\cursors\project1.lpi Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.FormCreate(Sender: TObject);var  Cur: TCursorImage;begin  Cur := TCursorImage.Create;  Cur.LoadFromResourceName(HInstance, 'car');  Screen.Cursors[1] := Cur.ReleaseHandle;  Cur.Free;  Button5.Cursor := 1;end; ---------------------------------------------------------------------- simsee · 2024-02-05 16:37 As I said in my post, I know this example, but I wanted to use a different approach, more suitable for my context. In the meantime, I solved it like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i implementationuses  LCLIntf; {$R *.lfm} {$R cursors.res} { TForm1 } procedure TForm1.Button1Click(Sender: TObject);begin  Screen.Cursor:=1;end; { TForm1 } initialization  Screen.Cursors[1]:=LoadCursor(HInstance, 'PENCIL');end. Anyway, thanks for the help.