[fpc-pascal] Mouse cursor in console program

Tomas Hajny XHajT03 at mbox.vol.cz
Wed Sep 13 19:58:40 CEST 2006


Kornel Kisielewicz wrote:

Hello,

> I tried to google for it, I searched in the documentation, but no luck:
> How to remove the mouse cursor that shows up in a w32 console program,
> when running fullscreen? If possible I would also like to avoid using
> windows unit...

I'm no Win32 programmer (I primarily use OS/2), but a simple test shows that:

1) Windows.ShowCursor (hinted to as the proper solution on MSDN ;-) )
doesn't seem to do anything in full screen.

2) The following sequence (as used in Win32 implementation of
Mouse.SysDoneMouse) seems to do the trick:

 GetConsoleMode(StdInputHandle, at mode);
 mode:=mode and (not ENABLE_MOUSE_INPUT);
 SetConsoleMode(StdInputHandle,mode);

I don't think that you can do this without using unit Windows (either
directly or indirectly), but I could imagine that somebody might provide
Win32 implementation of ShowMouse and HideMouse functions of unit Mouse
using this.

HTH

Tomas




More information about the fpc-pascal mailing list