[comp.windows.ms.programmer] How do I disable Mouse Input?

hansh@idca.tds.PHILIPS.nl (Hans Helmonds) (06/19/91)

Who knows a way to temporarily disable every mouse input to the system
and leave keyboard input and buffering enabled?
EnableHardwareInput() works only if you want to disable both mouse and
keyboard input. 

  ----------------+-----------------------------+--------------------
   Hans Helmonds  |  hansh@idca.tds.PHILIPS.nl  |  Tel +31 55 432161
      Philips     |  Apeldoorn, the Netherlands |  Fax +31 55 433004
 

bonneau@hyper.hyper.com (Paul Bonneau) (06/20/91)

In article <1405@ssp18.idca.tds.philips.nl> hansh@idca.tds.PHILIPS.nl (Hans Helmonds) writes:
>Who knows a way to temporarily disable every mouse input to the system
>and leave keyboard input and buffering enabled?
>EnableHardwareInput() works only if you want to disable both mouse and
>keyboard input. 
>
You could install a WindowsHook of type WH_GETMESSAGE (since
all user input is posted and must be retreived with
GetMessage() or PeekMessage()).  If you want mouse input
disabled, turn the mesage into something innocuous like
WM_NULL.  I have never tried this but it *should* work.

cheers - Paul Bonneau.

hans@pine.circa.ufl.edu (Hans van Oostrom) (06/20/91)

In article <1405@ssp18.idca.tds.philips.nl>, hansh@idca.tds.PHILIPS.nl (Hans Helmonds) writes...
>Who knows a way to temporarily disable every mouse input to the system
>and leave keyboard input and buffering enabled?
>EnableHardwareInput() works only if you want to disable both mouse and
>keyboard input. 
> 

The program that wants to disable the mouse could do a SetCapture.  
This will send all th mouse messages to the specified window.  There 
you can do whatever you want with it (like ignore it).  ReleaseCapture 
sets everything back.  The window that sets the capture doesn't 
has to be visible.


Hans van Oostrom
PO Box J-254, JHMHC                 hans@ufpine                (BITNET)
Gainesville, FL  32601, USA         hans@pine.circa.ufl.edu    (INTERNET)
>>>          Hoe ver je ook gaat, overal zie je landgenoten           <<<