Click to See Complete Forum and Search --> : Checking to see if a mouse is connected to a serial port...


cube01
September 8th, 1999, 08:13 PM
How can I check and see if a mouse (or any other device), is connected to a computers serial port?
I was thinking tryin' to read from the port, and if no data was received, then there was no device connected, but do mice and other devices constantly send data? or only when in use??

Thanks in advance.. Cube

Ted
September 22nd, 1999, 10:27 AM
I've spent days looking and have found nothing.
EnumPorts will tell you what ports you have.
TAPI can tell you if a modem is connected to a port.
But nothing I've found tells you if the mouse is connected.
Somehow the modems control panel dialog knows, cuz it doesn't make that port available for modems.
The MOUSE.DRV driver exports an Inquire function that tells you what com port the mouse is on but you can only use it if you're a system process.
It's not in the registry either.

Ted
September 23rd, 1999, 12:22 PM
Continuing adventures...

I tried opening VMOUSE as a device for IOCtl to get information from it but the open failed - VMOUSE does not support DeviceIOControl.

I tried using int 2fh to get Device API Entry Point so I cauld talk directly to the VMOUSE driver but you cannot call software interrupts in Windows programs!

If you just want to know the port is in use by something - try to open it with CreateFile. You'll get 'access denied' if the mouse (or anything else) is using the port.

terrylai
November 19th, 2000, 08:58 PM
Hello,

How to enter the system process?

Thanks!