برگرفته از فروم خارجی
Dim r As RECT
(HWND h=GetDlgItem(hwndDlg,IDC_YOURCTLID
GetWindowRect h, r ' get window rect of control relative to screen
POINT pt={r.left,r.top } 'new point object using rect x, y
Above means ->>>??? pt.x=r.left:pt.y=r.top '
ScreenToClient hwndDlg,pt ' convert screen co-ords to
client based points
example if I wanted to move said control'
-MoveWindow h,pt.x,pt.y+15,r.right-r.left, r.bottom
(r.top,TRUE
r.right - r.left, r.bottom - r.top to keep control at its '
current size
(void CMyButton::OnTimer(UINT nIDEvent
()DWORD GetMessagePos'
Point p(GetMessagePos
Dim p As PONIAPI And p=GetMessagePos ??? '
'BOOL ScreenToClient(HWND hWnd,LPPOINT lpPoint'
ScreenToClient hBtn ,p
(Get the bounds of the control (just the client area '
CRect rect
(BOOL GetClientRect(HWND hWnd,LPRECT lpRect'
GetClientRect hBtn,rect
Check the mouse is inside the control '
(BOOL PtInRect(const RECT *lprc,POINT pt'
if PtInRect(rect,p)<>0 Then
Else
...if not then stop looking '
m_bOverControl=FALSE
(BOOL KillTimer(HWND hWnd,UINT_PTR uIDEvent'
KillTimer lhwnd,m_nTimerID
...and redraw the control '
InvalidateRect ? Or Redraw
CButton::OnTimer(nIDEvent ??? '