Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2006-09

Mouse cursor in console program

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Kornel Kisielewicz

Hello all,

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...

At your service, Kornel Kisielewicz (adminATchaosforge.org) [http://chaosforge.org] My Princess has returned to me...

Reply by email

Tomas Hajny
to Kornel Kisielewicz

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,@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

Reply by email