// 发送控制码
if (!DeviceIoControl(hMouse, IOCTL_MOUSE_QUERY_ATTRIBUTES, &inputBuffer, sizeof(inputBuffer), &outputBuffer, sizeof(outputBuffer), &bytesRead, NULL))
{
std::cout << "Failed to send the control code." << std::endl;
return 1;
}
// 读取鼠标设备的数据
if (!ReadFile(hMouse, outputBuffer, sizeof(outputBuffer), &bytesRead, NULL))
{
std::cout << "Failed to read data from the mouse device." << std::endl;
return 1;
}