GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2010-10-05 18:13:14

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

window_set_cursor - not system compliant

It's not a bug, it's a feature.

Basically, the problem is that GM doesn't always use the system-defined cursors. Specifically, it comes prepackaged with cursors for the following constants:

cr_handpoint
cr_sqlwait
cr_multidrag
cr_drag
cr_hsplit
cr_vsplit
cr_nodrop

Some of these may not be part of Windows, but cr_handpoint is the stickler. That should be OCR_HAND, the cursor that appears when one hovers the pointer over a hyperlink. People want that cursor in their games.

The hand pointing cursor wasn't officially a part of Windows until Windows 2000. Game Maker at one time was meant to work on Windows 98, which would explain its absence. That's no longer true, so it's a shame it isn't properly supported.


Abusing forum power since 1986.

Offline

#2 2010-10-06 18:53:09

icuurd12b42
Member
Registered: 2008-12-11
Posts: 303

Re: window_set_cursor - not system compliant

Yeah, it's a shame Mark wrapped the function with his own constants (0-n) instead of reusing the ones in the winapi... 321023 or whatever... that way we could have simply pass on the number for the new cursors if the constant was not there...

My gmmouseext.dll allows loading cursors from file. It's not the perfect work arround because you have to distribute cursor files but it works.

Last edited by icuurd12b42 (2010-10-06 18:54:26)

Offline

#3 2010-10-06 23:11:35

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: window_set_cursor - not system compliant

I saw that DLL post in the GMC topic that prompted this one and now you've just answered my question about it. I was hoping it could select the cursors currently installed on the user's system.

I'm not a Windows API programmer, but it seems kind of tricky. I don't see a simple interface to change the cursor to one set up by the system. I see functions for loading and setting cursors to ones provided, but how do you specify one of the user-installed cursors? All I can figure is to find the resources specified in the registry. Problem is the default ones aren't specified in HKCU\\Control Panel\\Cursors or HKLM\\SOFTWARE\\Microsoft\\CurrentVersion\\Control Panel\\Cursors\\Schemes. I don't know where to find them.


Abusing forum power since 1986.

Offline

#4 2010-10-08 20:01:47

icuurd12b42
Member
Registered: 2008-12-11
Posts: 303

Re: window_set_cursor - not system compliant

Actually, I come to realise/remember that there are only 16 system cursors, which GM does include in the contants. Any other cursors have to be borrowed either by adding them in the resource (rc file) yourself (which mark likely did) or by stealing them from a working process or an installes dll or exe on the user system.

To see the default shared system cursors, go to your mouse control pannel.

^^ negates my statement I made in post #2.

And GM does follow your selected cursors, in the case of the 16 standard ones
#define IDC_ARROW MAKEINTRESOURCE(32512)
#define IDC_IBEAM MAKEINTRESOURCE(32513)
#define IDC_WAIT MAKEINTRESOURCE(32514)
#define IDC_CROSS MAKEINTRESOURCE(32515)
#define IDC_UPARROW MAKEINTRESOURCE(32516)
#define IDC_SIZENWSE MAKEINTRESOURCE(32642)
#define IDC_SIZENESW MAKEINTRESOURCE(32643)
#define IDC_SIZEWE MAKEINTRESOURCE(32644)
#define IDC_SIZENS MAKEINTRESOURCE(32645)
#define IDC_SIZEALL MAKEINTRESOURCE(32646)
#define IDC_NO MAKEINTRESOURCE(32648)
#define IDC_HAND MAKEINTRESOURCE(32649)
#define IDC_APPSTARTING MAKEINTRESOURCE(32650)
#define IDC_HELP MAKEINTRESOURCE(32651)
#define IDC_ICON MAKEINTRESOURCE(32641)
#define IDC_SIZE MAKEINTRESOURCE(32640)

I'm updatting the mouse dll, I added a function to used them numbers here... Though it's pointless unless you really want to use my dll for everything, as of now I have a wrapper to switch between my fns and gm's mouse fns.

However, if MS DOES add more system cursors, the change I added should be able to use them.

Last edited by icuurd12b42 (2010-10-08 20:08:38)

Offline

Board footer

Powered by FluxBB