Код: Выделить всё
#ifndef RATO_H
#define RATO_H
extern "C"
{
__declspec(dllexport) void mouse_move(char button, char x, char y, char wheel);
}
#endif
Код: Выделить всё
typedef struct {
char button;
char x;
char y;
char wheel;
char unk1;
} MOUSE_IO;
void mouse_move(char button, char x, char y, char wheel)
{
MOUSE_IO io;
io.unk1 = 0;
io.button = button;
io.x = x;
io.y = y;
io.wheel = wheel;
if (!callmouse(&io)) {
mouse_close();
mouse_open();
}
}
Код: Выделить всё
[DllImport("Rato.dll")]
public static extern void mouse_move(char button, char x, char y, char wheel);
mouse_move((char)0,(char)0,(char)-150,0);
EDIT: пытался преобразовать в сбайт, но получил ошибку
System.OverflowException: «Значение было слишком большим или слишком маленьким для знакового байта».
Код: Выделить всё
[DllImport("Rato.dll")]
public static extern void mouse_move(sbyte button, sbyte x, sbyte y, sbyte wheel);
mouse_move(0,0,Convert.ToSByte(-150),0);
Подробнее здесь: https://stackoverflow.com/questions/726 ... ported-dll
Мобильная версия