Main forum > Bug Reports

Hiding the mouse cursor - INLINE, user32 DLL option?

(1/3) > >>

Darmakwolf:
Hi all! I am working on a project and here's my conundrum. I want to display my own cursor, but I don't want the system cursor displaying over it. I know I can do SYSTEMPOINTER FALSE, but then the mouse is locked to the window. If I could maybe invoke user32.dll (SetSystemCursor?) - perhaps we can do SYSTEMPOINTER TRUE and invoke this dll call to tell Windows to hide the system cursor while in our app, we can achieve this. Thoughts? Anyone able to help?

Qedo:
so it can work ?

   LOADSPRITE "Media/yourpointer.png", 0
   LOCAL mx, my, b1, b2
    SYSTEMPOINTER FALSE
      REPEAT
         MOUSESTATE mx, my, b1, b2
         DRAWSPRITE 0,mx,my
         SHOWSCREEN
      UNTIL FALSE   
   END

ad maiora

Qedo:
   or better:

   LOADSPRITE "Media/Caricatore.png", 0
   LOCAL mx, my, b1, b2,sx,sy
    SYSTEMPOINTER TRUE
    GETSCREENSIZE sx,sy
      REPEAT
         MOUSESTATE mx, my, b1, b2
         IF mx>0 AND mx < sx AND my>0 AND my < sy
            SYSTEMPOINTER FALSE
         ELSE
            SYSTEMPOINTER TRUE
         ENDIF
         DRAWSPRITE 0,mx,my
         SHOWSCREEN
      UNTIL FALSE
   END

ad maiora

Darmakwolf:
No. The ol' "if outside screen, systempointer true" used to work on windows 7 and older. On 8 and newer the mouse gets stuck unless you the program in compatibility mode. The real solution here would be to invoke Windows API to hide the mouse CURSOR. When GLBasic does it, it GRABS the mouse and doesn't let it out of the bounding box until you turn that off, but then you have the mouse cursor over custom cursor issue again. Not a solution, but thank you. Just looking for someone's help WRAPPING USER32.DLL TO HIDE THE MOUSE.

Schranz0r:
If the Pointer is shown with SYSTEMPOINTER FALSE it's sounds like a bug to me...
So i move the topic to bugreport! :)

Navigation

[0] Message Index

[#] Next page

Go to full version