Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long 'OK Public Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long 'OK Public Declare Function GetClientRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long 'OK Public Declare Function ShowCursor Lib "user32" Alias "ShowCursor" (ByVal bShow As Long) As Long public sub MasquerCurseur ( Masquer as Boolean ) if Masquer then while showCursor ( 0 ) > 0 : Wend else while showCursor ( 1 ) < 0 : Wend Endif end sub
Private Sub Timer1_Timer() Dim R As RECT Dim Mouse As POINTAPI Call GetCursorPos(Mouse) Call GetClientRect(rtf.hWnd, R) Call ScreenToClient(rtf.hWnd, Mouse) If 0 = PtInRect(R, Mouse.x, Mouse.y) Then 'on est pas au dessus du RTF If mOver Then Call MasquerCurseur ( False ) mOver = False Else If Not mOver Then MasquerCurseur ( True ) mOver = True End If End Sub