Afrow UK
12th April 2006 14:53 UTC
SetCursor plugin
http://nsis.sf.net/File:SetCursor.zip
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
12th April 2006 15:52 UTC
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
12th April 2006 18:20 UTC
Made script header using System plugin instead:
http://nsis.sf.net/SetCursor_Script_Header
-Stu
Takhir
12th April 2006 18:35 UTC
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
12th April 2006 18:39 UTC
Code
This is code. Sorry, functions renaming is my hobby :)
Afrow UK
12th April 2006 20:16 UTC
Hmm thanks :)
It still didn't work if the file path name was less than 32 characters though (would cause a crash).
-Stu
JasonFriday13
13th April 2006 00:28 UTC
Great work man, that's the third plugin this month :).
Takhir
13th April 2006 06:56 UTC
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
13th April 2006 07:22 UTC
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
13th April 2006 10:21 UTC
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!)
http://nsis.sf.net/File:SetCursor.zip
-Stu