タイトル | : Re: マウスの左ボタンと右ボタン制御の交換 |
記事No | : 16605 |
投稿日 | : 2021/03/23(Tue) 17:11 |
投稿者 | : 魔界の仮面弁士 |
> マウスの左ボタンと右ボタンで行っていた制御を一時的に交換したい > のですが、どのようにプログラムすれば宜しいのでしょうか。
こんな感じで。
Option Explicit
#If VBA7 Then Private Declare PtrSafe Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoW" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long Private Declare PtrSafe Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long #Else Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoW" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long #End If
Public Property Let SwapMouseButton(bool As Boolean) Const SPI_SETMOUSEBUTTONSWAP As Long = 33& SystemParametersInfo SPI_SETMOUSEBUTTONSWAP, IIf(bool, 1&, 0&), ByVal 0&, ByVal 1& End Property
Public Property Get SwapMouseButton() As Boolean Const SM_SWAPBUTTON As Long = 23& SwapMouseButton = CBool(GetSystemMetrics(SM_SWAPBUTTON)) End Property
|