1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
PROCEDURE SimuleMouseEvent(_iEvent est un entier,_iX est un entier,_iY est un entier)
iResX est un entier
iResY est un entier
iResX = SysXRes()
iResY = SysYRes()
rCoefX est un réel
rCoefY est un réel
rCoefX = 65535/iResX
rCoefY = 65535/iResY
_iX = _iX*rCoefX
_iY = _iY*rCoefY
SELON _iEvent
CAS ::WM_LBUTTONDOWN
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_LEFTDOWN,_iX,_iY,0,0)
CAS ::WM_LBUTTONUP
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_LEFTUP,_iX,_iY,0,0)
CAS ::WM_LBUTTONDBLCLK
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_LEFTDOWN,_iX,_iY,0,0)
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_LEFTUP,_iX,_iY,0,0)
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_LEFTDOWN,_iX,_iY,0,0)
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_LEFTUP,_iX,_iY,0,0)
CAS ::WM_RBUTTONDOWN
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_RIGHTDOWN,_iX,_iY,0,0)
CAS ::WM_RBUTTONUP
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_LEFTUP,_iX,_iY,0,0)
CAS ::WM_RBUTTONDBLCLK
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_RIGHTDOWN,_iX,_iY,0,0)
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_LEFTUP,_iX,_iY,0,0)
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_RIGHTDOWN,_iX,_iY,0,0)
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_LEFTUP,_iX,_iY,0,0)
CAS ::WM_MBUTTONDOWN
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_MIDDLEUP,_iX,_iY,0,0)
CAS ::WM_MBUTTONUP
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_MIDDLEDOWN,_iX,_iY,0,0)
CAS ::WM_MBUTTONDBLCLK
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_MIDDLEUP,_iX,_iY,0,0)
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_MIDDLEDOWN,_iX,_iY,0,0)
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_MIDDLEUP,_iX,_iY,0,0)
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_MIDDLEDOWN,_iX,_iY,0,0)
CAS ::WM_MOUSEMOVE
_iX = PoidsFaible(CurseurPos(cpEcran ))
_iY = PoidsFort(CurseurPos(cpEcran ))
AppelDLL32("user32","SetCursorPos",_iX,_iY)
CAS ::WM_MOUSEWHEEL
AppelDLL32("user32","mouse_event",::MOUSEEVENTF_WHEEL,0,0,_iNb,0)
FIN |
Partager