Skip to content
⌘ NSIS Forum Archive

SetCursor plugin

10 posts

Afrow UK#

SetCursor plugin



You'll find that the custom cursors sections crash however. I can't find out why its crashing. LoadImage loads the file fine (apparently), but SetCursor crashes. If anybody can fix this please let me know 🙂

-Stu
Afrow UK#
Well SetClassLongPtr works (cursor changes)... for a few seconds and then it crashes lol

Seems to work fine when called with the System plugin though so I guess it's a problem caused when being called from a plugin.

-Stu
Afrow UK#
Made script header using System plugin instead:


-Stu
Takhir#
char szParam[MAX_PATH];
😉
Also
GetCursorPos(&cur);
SetCursorPos(cur.x, cur.y);
And IDC_* nsh header with LoadCursor(NULL, MAKEINTRESOURCE(my_atoi(szParam))); may be simpler then strings. Worked fine in my test including ani cursor.
Takhir#
Code

This is code. Sorry, functions renaming is my hobby 🙂
Afrow UK#
Hmm thanks 🙂
It still didn't work if the file path name was less than 32 characters though (would cause a crash).

-Stu
Takhir#
Works fine for me

Both with full path/name (including less then 32 chars) and SetOutPath + file name. I also added quotas to "$EXEDIR". Short sample attached.
Takhir#
System and File combination

BTW it is possible to combine repeating code of 2 cursor functions both in my /numeric/ and your /string/ cursor definition (as last else 🙂 ). And last hidden section in group with default cursor setting makes sample shorter 😉
Afrow UK#
Just making it easier for the NSIS programmer. No need for any defines to exist in their script. Also if I were to set the cursor back to the NORMAL cursor in a hidden section at the end, programmers may miss it when looking through the example.

I fixed the crashing, which wasn't actually being caused by the szParam being 32 characters. Had cursor defined globally and again in the File function (should have removed it like I did with the others!)



-Stu