#include-once #include Global Enum $PT_POINTER = 1, $PT_TOUCH = 2, $PT_PEN = 3, $PT_MOUSE = 4, $PT_TOUCHPAD = 5 Global Const $WM_NCPOINTERUPDATE = 0x0241 Global Const $WM_NCPOINTERDOWN = 0x0242 Global Const $WM_NCPOINTERUP = 0x0243 Global Const $WM_POINTERUPDATE = 0x0245 Global Const $WM_POINTERDOWN = 0x0246 Global Const $WM_POINTERUP = 0x0247 Global Const $WM_POINTERENTER = 0x0249 Global Const $WM_POINTERLEAVE = 0x024A Global Const $WM_POINTERACTIVATE = 0x024B Global Const $WM_POINTERCAPTURECHANGED = 0x024C Global Const $WM_TOUCHHITTESTING = 0x024D Global Const $WM_POINTERWHEEL = 0x024E Global Const $WM_POINTERHWHEEL = 0x024F Global Const $DM_POINTERHITTEST = 0x0250 Global Const $POINTER_MESSAGE_FLAG_NEW = 0x00000001 ; New pointer Global Const $POINTER_MESSAGE_FLAG_INRANGE = 0x00000002 ; Pointer has not departed Global Const $POINTER_MESSAGE_FLAG_INCONTACT = 0x00000004 ; Pointer is in contact Global Const $POINTER_MESSAGE_FLAG_FIRSTBUTTON = 0x00000010 ; Primary action Global Const $POINTER_MESSAGE_FLAG_SECONDBUTTON = 0x00000020 ; Secondary action Global Const $POINTER_MESSAGE_FLAG_THIRDBUTTON = 0x00000040 ; Third button Global Const $POINTER_MESSAGE_FLAG_FOURTHBUTTON = 0x00000080 ; Fourth button Global Const $POINTER_MESSAGE_FLAG_FIFTHBUTTON = 0x00000100 ; Fifth button Global Const $POINTER_MESSAGE_FLAG_PRIMARY = 0x00002000 ; Pointer is primary Global Const $POINTER_MESSAGE_FLAG_CONFIDENCE = 0x00004000 ; Pointer is considered unlikely to be accidental Global Const $POINTER_MESSAGE_FLAG_CANCELED = 0x00008000 ; Pointer is departing in an abnormal manner Func GET_POINTERID_WPARAM($wParam) Return _WinAPI_LoWord($wParam) EndFunc ;==>GET_POINTERID_WPARAM Func IS_POINTER_FLAG_SET_WPARAM($wParam, $iFlag) Return (BitAND(_WinAPI_HiWord($wParam), $iFlag) <> 0) EndFunc ;==>IS_POINTER_FLAG_SET_WPARAM Func IS_POINTER_NEW_WPARAM($wParam) Return IS_POINTER_FLAG_SET_WPARAM($wParam, $POINTER_MESSAGE_FLAG_NEW) EndFunc ;==>IS_POINTER_NEW_WPARAM Func IS_POINTER_INRANGE_WPARAM($wParam) Return IS_POINTER_FLAG_SET_WPARAM($wParam, $POINTER_MESSAGE_FLAG_INRANGE) EndFunc ;==>IS_POINTER_INRANGE_WPARAM Func IS_POINTER_INCONTACT_WPARAM($wParam) Return IS_POINTER_FLAG_SET_WPARAM($wParam, $POINTER_MESSAGE_FLAG_INCONTACT) EndFunc ;==>IS_POINTER_INCONTACT_WPARAM Func IS_POINTER_FIRSTBUTTON_WPARAM($wParam) Return IS_POINTER_FLAG_SET_WPARAM($wParam, $POINTER_MESSAGE_FLAG_FIRSTBUTTON) EndFunc ;==>IS_POINTER_FIRSTBUTTON_WPARAM Func IS_POINTER_SECONDBUTTON_WPARAM($wParam) Return IS_POINTER_FLAG_SET_WPARAM($wParam, $POINTER_MESSAGE_FLAG_SECONDBUTTON) EndFunc ;==>IS_POINTER_SECONDBUTTON_WPARAM Func IS_POINTER_THIRDBUTTON_WPARAM($wParam) Return IS_POINTER_FLAG_SET_WPARAM($wParam, $POINTER_MESSAGE_FLAG_THIRDBUTTON) EndFunc ;==>IS_POINTER_THIRDBUTTON_WPARAM Func IS_POINTER_FOURTHBUTTON_WPARAM($wParam) Return IS_POINTER_FLAG_SET_WPARAM($wParam, $POINTER_MESSAGE_FLAG_FOURTHBUTTON) EndFunc ;==>IS_POINTER_FOURTHBUTTON_WPARAM Func IS_POINTER_FIFTHBUTTON_WPARAM($wParam) Return IS_POINTER_FLAG_SET_WPARAM($wParam, $POINTER_MESSAGE_FLAG_FIFTHBUTTON) EndFunc ;==>IS_POINTER_FIFTHBUTTON_WPARAM Func IS_POINTER_PRIMARY_WPARAM($wParam) Return IS_POINTER_FLAG_SET_WPARAM($wParam, $POINTER_MESSAGE_FLAG_PRIMARY) EndFunc ;==>IS_POINTER_PRIMARY_WPARAM Func HAS_POINTER_CONFIDENCE_WPARAM($wParam) Return IS_POINTER_FLAG_SET_WPARAM($wParam, $POINTER_MESSAGE_FLAG_CONFIDENCE) EndFunc ;==>HAS_POINTER_CONFIDENCE_WPARAM Func IS_POINTER_CANCELED_WPARAM($wParam) Return IS_POINTER_FLAG_SET_WPARAM($wParam, $POINTER_MESSAGE_FLAG_CANCELED) EndFunc ;==>IS_POINTER_CANCELED_WPARAM Func EnableMouseInPointer($bEnable) Local $aRet = DllCall("user32.dll", "int", "EnableMouseInPointer", "bool", $bEnable) If @error Or $aRet[0] = 0 Then Return SetError(1) EndFunc ;==>EnableMouseInPointer Func IsMouseInPointerEnabled() Local $aRet = DllCall("user32.dll", "int", "IsMouseInPointerEnabled") If @error Then Return SetError(1) Return $aRet[0] EndFunc ;==>IsMouseInPointerEnabled Func GetPointerType($iPointer) Local $aRet = DllCall("user32.dll", "uint", "GetPointerType", "uint", $iPointer, "uint*", 0) If @error Or $aRet[0] = 0 Then Return SetError(1) Return $aRet[2] EndFunc