Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Mouse Button Detection

Mouse Button Detection

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    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?

    M 1 Reply Last reply
    0
    • L Lost User

      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?

      M Offline
      M Offline
      Mike Dunn
      wrote on last edited by
      #2

      Where did you get the info that the OS always returns 2 buttons? Both GetNumberOfConsoleMouseButtons() and GetSystemMetrics() return 5 for my IM Explorer me on 2K.

      L 1 Reply Last reply
      0
      • M Mike Dunn

        Where did you get the info that the OS always returns 2 buttons? Both GetNumberOfConsoleMouseButtons() and GetSystemMetrics() return 5 for my IM Explorer me on 2K.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        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!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups