Main forum > Bug Reports

Hiding the mouse cursor - INLINE, user32 DLL option?

<< < (3/3)

hardyx:
I think you can use Win32 functions declaring with the IMPORT command and calling.


--- Code: (glbasic) ---// If the hCursor is NULL, the cursor is removed from the screen.
IMPORT "C" void* __stdcall SetCursor(void* hCursor)

// hide windows cursor
SetCursor(0)

--- End code ---

Darmakwolf:

--- Quote from: hardyx on 2021-Jan-26 ---I think you can use Win32 functions declaring with the IMPORT command and calling.


--- Code: (glbasic) ---// If the hCursor is NULL, the cursor is removed from the screen.
IMPORT "C" void* __stdcall SetCursor(bool* hCursor)

// hide windows cursor
SetCursor(0)

--- End code ---

--- End quote ---

Problem solved! Thanks to your help with IMPORT. I found that SetCursor only hides the mouse *temporarily* every time it's called. However,
I found:

IMPORT "C" void* __stdcall ShowCursor(int bShow)

and you simply call it with ShowCursor(0)


Set SYSTEMPOINTER TRUE
This produces the desired behavior! The system mouse is hidden while inside the glbasic window, and shown while outside of it. I can draw my own cursor on-screen with drawsprite/anim, and it tracks properly.

woohoo - thank you!

Now if I could just get MOUSEAXIS(2) working, per my other post -_-

Navigation

[0] Message Index

[*] Previous page

Go to full version