Old 12th April 2006, 13:53   #1
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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 is offline   Reply With Quote
Old 12th April 2006, 14:52   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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 is offline   Reply With Quote
Old 12th April 2006, 17:20   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Made script header using System plugin instead:
http://nsis.sf.net/SetCursor_Script_Header

-Stu
Afrow UK is offline   Reply With Quote
Old 12th April 2006, 17:35   #4
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
code:
char szParam[MAX_PATH];

Also
code:
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 is offline   Reply With Quote
Old 12th April 2006, 17:39   #5
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Code

This is code. Sorry, functions renaming is my hobby
Attached Files
File Type: zip setcursor.zip (1.9 KB, 270 views)
Takhir is offline   Reply With Quote
Old 12th April 2006, 19:16   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Hmm thanks
It still didn't work if the file path name was less than 32 characters though (would cause a crash).

-Stu
Afrow UK is offline   Reply With Quote
Old 12th April 2006, 23:28   #7
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 916
Great work man, that's the third plugin this month .

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 13th April 2006, 05:56   #8
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
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.
Attached Files
File Type: nsi examplemui.nsi (678 Bytes, 284 views)
Takhir is offline   Reply With Quote
Old 13th April 2006, 06:22   #9
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
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
Attached Files
File Type: zip setcursor.zip (7.1 KB, 304 views)
Takhir is offline   Reply With Quote
Old 13th April 2006, 09:21   #10
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump