Microsoft KB Archive/69806

PRWIN9103027: System Metrics Not Updated by SwapMouseButton ID Number: Q69806

3.00 WINDOWS buglist3.00 fixlist3.10

Summary:

PROBLEM ID: WIN9103027

SYMPTOMS GetSystemMetics(SM_SWAPBUTTON) always returns the state of the mouse buttons as specified in the WIN.INI file.

CAUSE When the SwapMouseButton function is used to swap the function of the left and right mouse buttons, the system metric is not updated.

STATUS Microsoft has confirmed this to be a problem in Windows version 3.0. This problem was corrected in Windows version 3.1.

More Information:

If it is necessary to keep track of the state of the mouse buttons, the application must call GetSystemMetrics(SM_SWAPBUTTON) during its initialization phase. This will return the state of the mouse buttons as indicated in the WIN.INI file. At each call to SwapMouseButton, the value of this Boolean variable should be toggled to reflect the current state of the mouse buttons.

If the change to the state of the mouse buttons is to be permanent, the WIN.INI file must be updated using the WriteProfileString function. Please note that the SwapMouseButton function is usually called only by the Control Panel. Although applications are free to call the function, the mouse is a shared resource. Reversing the state of the mouse buttons will affect all applications.

Additional reference words: 3.00 SR# G910202-11