The GetSystemMetrics function is used to determine whether a mouse is installed and whether the mouse buttons are swapped.
please check the code below,
void CheckMouse() { BOOL fResult; // Determine whether the mouse buttons are installed. fResult = GetSystemMetrics(SM_MOUSEPRESENT); if (fResult == 0) { printf("No mouse installed.\n"); } else { printf("Mouse installed.\n"); // Determine whether the buttons are swapped. fResult = GetSystemMetrics(SM_SWAPBUTTON); if (fResult == 0) printf("Buttons not swapped.\n"); else printf("Buttons swapped.\n"); } }
Advertisements
Leave a Reply