GetSystemMetrics(SM_MOUSEWHEELPRESENT) returns 0 in remote desktop session in Windows 8.1 or Windows Server 2012 R2

Applies to: Windows Server 2012 R2 DatacenterWindows Server 2012 R2 EssentialsWindows Server 2012 R2 Standard

Symptoms


Assume that you have an application that is running in a remote desktop session in Windows 8.1 or in Windows Server 2012 R2. The application calls
GetSystemMetrics(SM_MOUSEWHEELPRESENT) to check whether a mouse wheel is present on an attached mouse device. In this situation, Windows will always return 0 because the Remote Desktop service reports that a 2-button mouse is attached that does not include a mouse wheel. 

This can affect applications that rely upon GetSystemMetrics when it determines whether to process mouse wheel input. 

More Information


Applications can call GetSystemMetrics together with the SM_MOUSEWHEELPRESENT flag to check whether a mouse wheel is present on an attached mouse device. GetSystemMetrics returns a nonzero value if a mouse device that includes a mouse wheel is installed. Otherwise, the function returns zero.

Applications or third-party controls that call GetSystemMetrics(SM_MOUSEWHEELPRESENT) to determine whether a mouse wheel is present may not process mouse wheel input when GetSystemMetrics reports that a mouse wheel is not present. These applications or third-party controls can be updated to process mouse wheel input regardless of whether GetSystemMetrics reports that a mouse wheel is present.