C++ Code need complite it

hey i want complite this code please help me

what code is do is disable the Accelertion of the mouse if someone did please upload it to 2shared or any upload website thanks guys what i know from this code is that he change the SPI_GETMouse to 0 and SPI_SETMOUSE 0

(Code)

int oldAccel[3], newAccel[3], oldSpeed, newSpeed, x, y;
02.
BOOL bResult;
03.

04.
// 以下の値でマウスの移動量を 1 ミッキー/ピクセルに設定する
05.
newAccel[0] = 0;
06.
newAccel[1] = 0;
07.
newAccel[2] = 0;
08.
newSpeed = 1;
09.

10.
// 現在のマウス加速度定数を保存する
11.
bResult = SystemParametersInfo(SPI_GETMOUSE, 0, oldAccel, 0);
12.
bResult = SystemParametersInfo(SPI_GETMOUSESPEED, 0, &oldSpeed, 0);
13.

14.
// マウス加速度定数(無効)を設定する
15.
bResult = SystemParametersInfo(SPI_SETMOUSE, 0, newAccel,
16.
SPIF_SENDCHANGE);
17.
bResult = SystemParametersInfo(SPI_SETMOUSESPEED, 0, &newSpeed,
18.
SPIF_SENDCHANGE);
19.

20.
//任意の x, y 座標を設定する
21.
x = -100;
22.
y = -150;
23.

24.
mouse_event(MOUSEEVENTF_ABSOLUTE, 0, 0, 0, 0);
25.

26.
// 標準モニタの左上(原点)にカーソルを移動する
27.
mouse_event(0, x, y, 0, 0);
28.
// カーソルを要求された座標に移動する
29.

30.
// 保存したマウス加速度定数を戻す
31.
bResult = SystemParametersInfo(SPI_SETMOUSE,0, oldAccel,
32.
SPIF_SENDCHANGE);
33.
bResult = SystemParametersInfo(SPI_SETMOUSESPEED, 0, &oldSpeed,
34.
SPIF_SENDCHANGE);

(End Code)
Last edited on
This would be better outside of the Jobs section. What exactly did you mean by "complete" the code? In any case, here are the comments translated:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
int oldAccel[3], newAccel[3], oldSpeed, newSpeed, x, y;
BOOL bResult;

// The following values are for the mouse to move 1 pixel per mickey (a mickey is a unit for the smallest detectable movement of a mouse)
newAccel[0] = 0;
newAccel[1] = 0;
newAccel[2] = 0;
newSpeed = 1;

// Save the current settings for mouse speed and acceleration
bResult = SystemParametersInfo(SPI_GETMOUSE, 0, oldAccel, 0);
bResult = SystemParametersInfo(SPI_GETMOUSESPEED, 0, &oldSpeed, 0);

// Set the mouse speed and acceleration to our constants
bResult = SystemParametersInfo(SPI_SETMOUSE, 0, newAccel, SPIF_SENDCHANGE);
bResult = SystemParametersInfo(SPI_SETMOUSESPEED, 0, &newSpeed, SPIF_SENDCHANGE);

// Set some arbitrary x and y coordinates
x = -100;
y = -150;

mouse_event(MOUSEEVENTF_ABSOLUTE, 0, 0, 0, 0);
// Move the mouse the top-left (origin) of the monitor screen

mouse_event(0, x, y, 0, 0);
// Move the cursor to the desired x and y coordinates

// Revert the mouse speed and acceleration settings to their original values
bResult = SystemParametersInfo(SPI_SETMOUSE, 0, oldAccel, SPIF_SENDCHANGE);
bResult = SystemParametersInfo(SPI_SETMOUSESPEED, 0, &oldSpeed, SPIF_SENDCHANGE);
Topic archived. No new replies allowed.