کدام درست و منطقی تر است ؟
WM_MOUSEMOVE
Dim rc As RECT
Din pt As POINT
SetRect rc, 0,0,5,5
(Pt.x=LOWORD(LParam
(Pt.y=HIWORD(LParam
if PtInRect(rc,pt.x,pt.y) Then
Msgbox "in"
Else
Msgbox "Out"
End If
For x = rc.Left To rc.Right
For y = rc.Top To rc.Bottom
If PtInRect(rc, x, y) Then
Msgbox "in"
Else
Msgbox "Out"
End If
Next y
Next x
Dim mousept As POINTAPI
Dim winrect As RECT
with winrect
left=5.
top=0.
right=5.
bottom=5.
End With
GetCursorPos mousept
GetWindowRect hWnd, winrect'
SetRect 5,0,5,5?'
ScreenToClient ?'
(isinside=PtInRect(winrect, mousept.x, mousept.y
If isinside = 1 Then
Debug.Print "The mouse cursor is currently inside
".of Form1
Else
Debug.Print "The mouse cursor is currently outside
".of Form1
End If
Dim pt As POINTAPI
Dim BtnRect As RECT
WM_MOUSEMOVE
GetWindowRect BtnHwnd,BtnRect
(pt.x=loword(lparam
(pt.y=hiword(lparam
ClientToScreen BtnHwnd,pt
If PtInRect(BtnRect,pt.x,pt.y) Then