The information in this article applies to:
SUMMARY
A Windows-based application can use the GetSystemMetrics() function to determine whether or not a serial mouse is connected to the computer.
However, there is no Windows application programming interface (API) to
identify the serial port of the computer that the mouse is connected to.
Instead, a Windows-based application must use the Inquire() function
documented in the Windows Device Driver Kit (DDK). You do not need the the
Windows DDK to call the Inquire() function in the MOUSE driver module. Please see "MORE INFORMATION" for details.
MORE INFORMATION
If GetSystemMetrics() is called with its parameter set to SM_MOUSEPRESENT, it will indicate whether or not a serial mouse is connected. However, no
information is provide as to which port of the computer the serial mouse is
connected to.
The Inquire() function returns information about the mouse hardware.
Points to a MOUSEINFO structure containing information about the mouse hardware that is present, the number of buttons on the mouse, and the rate at which the mouse can issue interrupts. The MOUSEINFO structure has the following form.
Return Value: The return value is the number of bytes actually written into the MOUSEINFO structure. Comments: The export ordinal for this function is 1. This function can be called from within a Windows-based application without the presence of the DDK. To call this function, the function address must be retrieved as follows:
Then, the Inquire() function can be called using the lpfnInquire pointer. The msExist and msMouseCommPort parameters in the MOUSEINFO structure provide the needed information.
Note that the mouse driver is not called MOUSE.DRV on many systems, and therefore it is suggested that GetModuleHandle() is used to obtain the handle to the mouse driver instead of LoadLibrary, which requires the filename of the mouse driver. Additional query words: 3.10 mouse port driver detect
Keywords : kb16bitonly kbInput kbMouse kbSDKPlatform |
Last Reviewed: June 7, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |