Recent

Author Topic: [solved] Mouse cursor - Custom / loading  (Read 18256 times)

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Mouse cursor - Custom / loading
« Reply #15 on: October 10, 2011, 04:09:26 pm »
Create one near the final end of your unit:

Code: [Select]
initialization
{$I myresource.lrs}
end.

Vlado

  • New Member
  • *
  • Posts: 33
Re: Mouse cursor - Custom / loading
« Reply #16 on: October 10, 2011, 04:46:43 pm »
@Typo: that was there!

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Mouse cursor - Custom / loading
« Reply #17 on: October 10, 2011, 06:24:46 pm »
Replace "myresource" with the resource name shown by LazRes.

Code: [Select]
Screen.Cursors[1] := LoadCursorFromLazarusResource('cursorname'); 

On Windows, make a BAT file with the following code:

Code: [Select]
lazres myresource.lrs cursorname.cur
pause

and use it instead of running LazRes directly. Then you will see the resource name shown by LazRes.
« Last Edit: October 10, 2011, 07:24:40 pm by typo »

Vlado

  • New Member
  • *
  • Posts: 33
Re: Mouse cursor - Custom / loading
« Reply #18 on: October 10, 2011, 09:18:16 pm »
@Typo & all: Thank you! Finally works, that was kind of a trick :))
« Last Edit: October 12, 2011, 06:44:12 am by vlado »

Vlado

  • New Member
  • *
  • Posts: 33
Re: [solved 1/2] Mouse cursor - Custom / loading
« Reply #19 on: October 12, 2011, 06:44:23 am »
Furthermore, how can we put that cursor file(s) inside .exe file?

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: [solved 1/2] Mouse cursor - Custom / loading
« Reply #20 on: October 12, 2011, 07:33:01 am »
Aren't resources are always added inside .exe? And if you were to use an image you can add and load it from the resource.

Vlado

  • New Member
  • *
  • Posts: 33
Re: [solved 1/2] Mouse cursor - Custom / loading
« Reply #21 on: October 12, 2011, 10:10:11 am »
Huh, thanks! Didn't know that! I thought that resources are external files, but it seems that they are inside .exe.

 

TinyPortal © 2005-2018