我基本上直接从
MSDN documentation复制了以下代码:
#include <windows.h> #include <stdio.h> #pragma comment(lib,"user32.lib") int main() { BOOL fResult; int aMouseInfo[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.
如果aMouseInfo [2]设置为TRUE(或指定除0以外的任何编号),则“增强鼠标精度”字段为SET,如果为FALSE(或指定为0),则“增强鼠标精度”字段为UNSET.
要获取和设置Mousespeed,您可以使用SPI_GETMOUSESPEED和SPI_SETMOUSESPEED resp.
要使用SPI_GETMOUSESPEED和SPI_SETMOUSESPEED,请参阅post.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。