Code
OpenWindow(0,0,0,320,240,"System Cursor Changer",#PB_Window_ScreenCentered)
CreateGadgetList(WindowID(0))
ButtonGadget(0,100,100,100,20,"New Cursor")
ButtonGadget(1,100,130,100,20,"Old Cursor")
ButtonGadget(2,100,160,100,20,"Quit")
Repeat
quit=0
ev=WaitWindowEvent()
If ev=#PB_Event_Gadget
Select EventGadget()
Case 0
newcursor=LoadImage_(0,OpenFileRequester("Select a Cursor","c:\windows\cursors\","Cursors (*.cur)|*.cur",0),#IMAGE_CURSOR,0,0,#LR_LOADFROMFILE|#LR_DEFAULTSIZE)
oldcursor=GetCursor_() ;get a handle to the current cursor
oldcursor=CopyIcon_(oldcursor) ;save a copy of the cursor
If newcursor
SetSystemCursor_(newcursor, #OCR_NORMAL)
DisableGadget(0,1)
EndIf
Case 1
SetSystemCursor_(oldcursor, #OCR_NORMAL)
DisableGadget(0,0)
Case 2
SetSystemCursor_(oldcursor, #OCR_NORMAL)
quit=1
EndSelect
EndIf
Until quit