Archive: SetCursor plugin


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


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


Made script header using System plugin instead:
http://nsis.sf.net/SetCursor_Script_Header

-Stu


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.

Code
This is code. Sorry, functions renaming is my hobby :)


Hmm thanks :)
It still didn't work if the file path name was less than 32 characters though (would cause a crash).

-Stu


Great work man, that's the third plugin this month :).


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.


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 ;)


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