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. API to change win10 touchpad 'Cursor speed' dynamically without restarting

API to change win10 touchpad 'Cursor speed' dynamically without restarting

Scheduled Pinned Locked Moved C / C++ / MFC
windows-adminjsonperformancehelp
3 Posts 2 Posters 1 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.
  • A Offline
    A Offline
    AroraSaurabh
    wrote on last edited by
    #1

    We need to reduce touchpad cursor speed in certain state in our application. So, i was planning that when the application enter a specific state, we will change touchpad cursor speed at run time by using some Windows API. And when coming out of the specific state, revert the touchpad cursor speed to original value. However, i did not find any Windows API to change touchpad 'Cursor speed' dynamically without restarting. I found API to change mouse speed (SystemParametersInfo). But this API only changes the mouse cursor speed. It does not change touchpad cursor speed. I tried changing the below registry. But the problem with changing registry is that touchpad cursor speed gets updated only after system restart. I need an API to change touchpad cursor speed without restarting system (similar to how we can change mouse speed using SystemParametersInfo) HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\CursorSpeed Any suggestions in this regard will be really very helpful.

    L 2 Replies Last reply
    0
    • A AroraSaurabh

      We need to reduce touchpad cursor speed in certain state in our application. So, i was planning that when the application enter a specific state, we will change touchpad cursor speed at run time by using some Windows API. And when coming out of the specific state, revert the touchpad cursor speed to original value. However, i did not find any Windows API to change touchpad 'Cursor speed' dynamically without restarting. I found API to change mouse speed (SystemParametersInfo). But this API only changes the mouse cursor speed. It does not change touchpad cursor speed. I tried changing the below registry. But the problem with changing registry is that touchpad cursor speed gets updated only after system restart. I need an API to change touchpad cursor speed without restarting system (similar to how we can change mouse speed using SystemParametersInfo) HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\CursorSpeed Any suggestions in this regard will be really very helpful.

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

      If you change the touchpad cursor speed at the control panel, the change occurs immediately. So there must be some method of notifying Windows that the change has been made. This may be through WMI: take a look at the WMI documentation. Or PowerShell.

      1 Reply Last reply
      0
      • A AroraSaurabh

        We need to reduce touchpad cursor speed in certain state in our application. So, i was planning that when the application enter a specific state, we will change touchpad cursor speed at run time by using some Windows API. And when coming out of the specific state, revert the touchpad cursor speed to original value. However, i did not find any Windows API to change touchpad 'Cursor speed' dynamically without restarting. I found API to change mouse speed (SystemParametersInfo). But this API only changes the mouse cursor speed. It does not change touchpad cursor speed. I tried changing the below registry. But the problem with changing registry is that touchpad cursor speed gets updated only after system restart. I need an API to change touchpad cursor speed without restarting system (similar to how we can change mouse speed using SystemParametersInfo) HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\CursorSpeed Any suggestions in this regard will be really very helpful.

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

        Member 9453331 wrote:

        I tried changing the below registry. But the problem with changing registry is that touchpad cursor speed gets updated only after system restart. I need an API to change touchpad cursor speed without restarting system (similar to how we can change mouse speed using SystemParametersInfo) HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\CursorSpeed Any suggestions in this regard will be really very helpful.

        If you need to restart the touchpad driver then you could probably use the [Setupapi](https://docs.microsoft.com/en-us/windows/desktop/devinst/setupapi-h). I believe that you will need to first call [SetupDiSetClassInstallParams](https://docs.microsoft.com/en-us/windows/desktop/api/setupapi/nf-setupapi-setupdisetclassinstallparamsw) with the SP_CLASSINSTALL_HEADER.InstallFunction set to [DIF_PROPERTYCHANGE](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/dif-propertychange) followed by a call to the [SetupDiCallClassInstaller function](https://docs.microsoft.com/en-us/windows/desktop/api/setupapi/nf-setupapi-setupdicallclassinstaller) with the DI_FUNCTION also set to [DIF_PROPERTYCHANGE](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/dif-propertychange). Be aware that many touchpad drivers are written by third-party vendor (i.e. not Microsoft). I don't think all touchpad drivers support being restarted from the Setup API. It really depends on how the third-party vendor has implemented their [driver co-installer](https://msdn.microsoft.com/en-us/library/windows/hardware/ff553394(v=vs.85).aspx). The Windows operating system is 'aware' of the co-installer capabilities from when the [co-installer was registered](https://docs.microsoft.com/en-us/windows/desktop/api/Setupapi/nf-setupapi-setupdiregistercodeviceinstallers). If you want to check if your touchpad supports enable/disable then go into the device manager and right click... if you see 'Disable Device' then that means that the co-installer supports device restart. Believe it or not the touchpad device driver itself probably supports [start/stop](https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/irp-mn-start-device) so there is nothing preventing you from developing a co-installer and registering it as the handler for the third-party touchpad driver as long as the co-installer DLL is not part of a [digitally-signed catalog](https://docs.microsoft.com/en-us/windows-hardware/drive

        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