Changing the cursor

BlitzPlus Forums/BlitzPlus Programming/Changing the cursor

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Here, I found this topic:
http://www.blitzbasic.com/Community/posts.php?topic=33747

you can also change the system cursor:
;.lib "user32.dll"
;
;api_DestroyCursor% (hCursor%) : "DestroyCursor"
;api_SetSystemCursor% (hcur%, id%) : "SetSystemCursor"
;api_CreateCursor% (hInstance%, nXhotspot%, nYhotspot%, nWidth%, nHeight%, lpANDbitPlane*, lpXORbitPlane*) : "CreateCursor"
;api_LoadCursor% (hInstance%, lpCursorName%) : "LoadCursorA"
;-----------------------



;!if you run this program, the cursor will change
;even after the program is done!
;you can go to (windows) START->SETTINGS->MOUSE-> and 
;change the scheme to change it back.

Graphics 800, 600, 0, 2

bank1 = CreateBank(32)
bank2 = CreateBank(32)

;this is a bitmap, which means 8 pixels are stored in a single number
;i wrote the bits separately, you can replace them with a zero to make them black
For j = 0 To 15
For i = 0 To 1
    ;color 1 (AND)
	PokeByte bank1, j + i * 16, 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128
	;color 2 (OR)
	PokeByte bank2, j + i * 16, 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128
Next
Next

;create cursor
cursor = api_CreateCursor(0, 0, 0, 16, 16, bank1, bank2)
api_SetSystemCursor(cursor, 32512)

WaitKey()

api_DestroyCursor(cursor)

FreeBank bank1
FreeBank bank2

End