Changing the cursor

BlitzPlus Forums/BlitzPlus Programming/Changing the cursor

William Drescher(Posted 2007) [#1]
I have an API call for user32.dll but I'm not quite sure how to use it... If someone could help me I would really appreciate it :)

.lib "user32.dll"

API_LoadCursor%(ID,Cursor):"LoadCursorA" 
API_SetCursor%(ID):"SetCursor"



b32(Posted 2007) [#2]
Here, I found this topic:
http://www.blitzbasic.com/Community/posts.php?topic=33747

you can also change the system cursor:



William Drescher(Posted 2007) [#3]
That's cool, but what's the ID% part of it for exactly?


b32(Posted 2007) [#4]
'ID' is the handle, an integer value. I think it is the adress in memory where the cursor is stored.
The first parameter of LoadCursor is 'hInstance' not 'id', it is a handle for a window. That is also an integer value that identifies the window in Windows.
http://blogs.msdn.com/oldnewthing/archive/2005/04/18/409205.aspx

edit:
just realized you ment id in the previous code ..
So that ID is which cursor you want to redefine. There are several types of cursors: point, hourglass etc. Each cursor has an ID code:
http://msdn2.microsoft.com/en-us/library/ms648395.aspx
On msdn, they're called OCR_APPSTARTING, OCR_NORMAL, OCR_CROSS etc, but these are consts which means they represent numbers:
http://www.autoitscript.com/forum/lofiversion/index.php?t22214.html
(3rd post in the thread, found it by google search: const OCR_NORMAL)