C&C++   发布时间:2022-04-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了(C)带SPI_SetMouse的SystemParametersInfo似乎不会改变光标速度大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我基本上直接从 @L_618_0@复制了以下代码

#include <windows.h>
#include <stdio.h>
#pragma comment(lib,"user32.lib")

int main()
{
   BOOL fResult;
   int aR_232_11845@ouseInfo[3];       // array for mouse information

   // Get the current mouse speed. 

   fResult = SystemParametersInfo(
      SPI_GETMOUSE,// get mouse information 
      0,// not used 
      &amouseInfo,// holds mouse information
      0);             // not used 

   // Double it. 

   if( fResult )
   {
      amouseInfo[2] =  1; // 2 * amouseInfo[2]; 
      // 1 should be a very noticeable change: slowing the cursor way down
      // Change the mouse speed to the new value. 

      SystemParametersInfo(
         SPI_SETMOUSE,// set mouse information
         0,// not used 
         amouseInfo,// mouse information 
         SPIF_SENDCHANGE);  // update win.ini 
   }
   return 0;
}

然而,当我运行它时,似乎没有任何事情发生.鼠标速度应该改变,但事实并非如此.

Windows Vista Home x32(ouch)
Dev-C便携式

解决方法

这里,amouseInfo [2]指的是Enhance Mouse Precision字段.
如果amouseInfo [2]设置为TRUE(或指定除0以外的任何编号),则“增强鼠标精度”字段为SET,如果为falSE(或指定为0),则“增强鼠标精度”字段为UNSET.

获取和设置Mousespeed,您可以使用SPI_GETMOUSESPEED和SPI_SETMOUSESPEED resp.

要使用SPI_GETMOUSESPEED和SPI_SETMOUSESPEED,请参阅post.

大佬总结

以上是大佬教程为你收集整理的(C)带SPI_SetMouse的SystemParametersInfo似乎不会改变光标速度全部内容,希望文章能够帮你解决(C)带SPI_SetMouse的SystemParametersInfo似乎不会改变光标速度所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。