CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 1999
    Posts
    535

    Checking to see if a mouse is connected to a serial port...

    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


  2. #2
    Join Date
    May 1999
    Posts
    3

    Re: Checking to see if a mouse is connected to a serial port...

    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.



  3. #3
    Join Date
    May 1999
    Posts
    3

    Re: Checking to see if a mouse is connected to a serial port...

    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.


  4. #4
    Join Date
    Sep 2000
    Posts
    100

    Re: Checking to see if a mouse is connected to a serial port...

    Hello,

    How to enter the system process?

    Thanks!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured