That's rather complicated. Mouse pointers are part of the window manager system, therefore they are highly platform dependent. You probably need to be looking into the API of the specific platform you are targeting.
My result was a DLL for GM:S. The problem with GameMaker:Studio is that it doesn't allow you to access the mouse coordinates outside of the screen. Thus I made this: