Hide Mouse

Just starting out? Need help? Post your questions and find answers here.
User avatar
SPH
Enthusiast
Enthusiast
Posts: 627
Joined: Tue Jan 04, 2011 6:21 pm

Hide Mouse

Post by SPH »

Hi

On Windows 11, I have an OpenScreen program with the mouse cursor hidden.
Or at least, partially hidden. I can't hide it completely.
The cursor itself is invisible, but the blue reflection ring is still visible on the screen.
How do I get rid of it?

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
miso
Enthusiast
Enthusiast
Posts: 623
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: Hide Mouse

Post by miso »

Hi SPH!

I think there are unprocessed OS events. Try to process all in the beginning of every loop, and it will disappear.
(I assume its a windowed screen)

Code: Select all

While WindowEvent() : Wend
User avatar
SPH
Enthusiast
Enthusiast
Posts: 627
Joined: Tue Jan 04, 2011 6:21 pm

Re: Hide Mouse

Post by SPH »

I only use OpenScreen... So, apparently, I can't use your trick.
On one Windows 11 PC, the mouse cursor is completely invisible, but not on the other Windows 11 PC (the mouse cursor is partially visible).

But, thx you for your help :idea:

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 5022
Joined: Sun Apr 12, 2009 6:27 am

Re: Hide Mouse

Post by RASHAD »

Try

Code: Select all

CreateImage(0, 32,32)
CreateImage(1, 32,32)

StartDrawing(ImageOutput(0))
  Box(0,0,32,32,#White)
StopDrawing()

icoInf.ICONINFO
icoInf\fIcon = #False
icoInf\hbmMask = ImageID(0)
icoInf\hbmColor = ImageID(1)

curHnd = CreateIconIndirect_(icoInf)
; 
For x = 32512 To 32650                      ;Hide System cursor
    SetSystemCursor_(CopyIcon_(curHnd),  x)
Next
Delay(5000)
SystemParametersInfo_(#SPI_SETCURSORS,0,0,0)  ;Show System Cursor
Egypt my love
Post Reply