Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / How to change the cursor on Windows without hidding it and using sprite?

Author
Message
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 17th May 2016 21:32
How to change the cursor on Windows without hidding it and using sprite?

I use the tier2 with this commands :

ActiveCursor = LoadCursorFromFile(TEXT("arrow.cur"));
SetCursor(ActiveCursor);

but nothing is happening...

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 18th May 2016 10:14
check if you get at first the handle (return value from LoadCursorFromFile)
Quote: "Type: HCURSOR
If the function is successful, the return value is a handle to the new cursor.
If the function fails, the return value is NULL.
To get extended error information, call GetLastError. GetLastError may return the following value."

or try loadcursor as test
https://msdn.microsoft.com/en-us/library/windows/desktop/ms648391%28v=vs.85%29.aspx

or loadimage with uType = IMAGE_CURSOR and createcursor
https://msdn.microsoft.com/en-us/library/windows/desktop/ms648045%28v=vs.85%29.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms648393%28v=vs.85%29.aspx
AGK (Steam) V2.0.18 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 18th May 2016 11:40
thanks Markus.
But when I use the SetSystemCursor instead of SetCursor command - it works fine... (but it changes a cursor in the whole system)
I'll try your advise bit later today.

Login to post a reply

Server time is: 2024-09-29 15:20:38
Your offset time is: 2024-09-29 15:20:38