Using a Function in a DLL : Windows API « Windows API « VBA / Excel / Access / Word






Using a Function in a DLL

 
    Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
    Public Const SM_SWAPBUTTON = 23
    Sub ShowHands()
       If GetSystemMetrics(SM_SWAPBUTTON) = False Then
           MsgBox "Your mouse is right-handed!"
       Else
           MsgBox "Your mouse is left-handed!"
        End If
    End Sub

 








Related examples in the same category

1.Use 32-bit API declaration
2.Declaring an External Function to the Compiler
3.Playing .Wav files via the Windows API
4.Waiting for an application to end