Mouse Button Detection
-
I have MSVC++ 5.0 I want a RELIABLE method of detecting the number of buttons a mouse has within my program (inclusive of the Intellimouse Explorer), that will work under Windows 95/98/2000 and NT! I already know the following: 1.)Win32 will always report 2 mouse buttons no matter what type of mouse is connected to the system. 2.)Attempting to use the following code: if ((hMouse = GetModuleHandle ("MOUSE")) != NULL) lpfnInquire = (LPFNINQUIRE) GetProcAddress( hMouse, "Inquire" ); This technique will only work if MOUSE.EXE is specified as being loaded under the WIN.INI file! (Most people don't do this anyway, at least under 95. And I don't want to mess up other people's systems by writing to the WIN.INI!) 3.)I DO NOT want to have a list of every possible mouse type that can be connected to the system! (hoplessly dating my program!) There should be a way (short of writing my own mouse driver) that I can detect the mouse driver and obtain this (number of buttons) information. What is it?
-
I have MSVC++ 5.0 I want a RELIABLE method of detecting the number of buttons a mouse has within my program (inclusive of the Intellimouse Explorer), that will work under Windows 95/98/2000 and NT! I already know the following: 1.)Win32 will always report 2 mouse buttons no matter what type of mouse is connected to the system. 2.)Attempting to use the following code: if ((hMouse = GetModuleHandle ("MOUSE")) != NULL) lpfnInquire = (LPFNINQUIRE) GetProcAddress( hMouse, "Inquire" ); This technique will only work if MOUSE.EXE is specified as being loaded under the WIN.INI file! (Most people don't do this anyway, at least under 95. And I don't want to mess up other people's systems by writing to the WIN.INI!) 3.)I DO NOT want to have a list of every possible mouse type that can be connected to the system! (hoplessly dating my program!) There should be a way (short of writing my own mouse driver) that I can detect the mouse driver and obtain this (number of buttons) information. What is it?
-
Where did you get the info that the OS always returns 2 buttons? Both
GetNumberOfConsoleMouseButtons()
andGetSystemMetrics()
return 5 for my IM Explorer me on 2K.Still in need of an answer! Will not work under Windows 95!!! (I know, I tried BOTH, and both give the same answer (2 buttons))! The app I am designing is to be a mouse/keyboard remapper, and is to be TSR (so I can't play tricks like capturing the mouse in a screen and disecting the packet structure!) Need help please! I've wasted a week already on this problem!