ش | ی | د | س | چ | پ | ج |
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 |
باعث میشود که Tooltip در مختصات پیام آخرین ماوس ارسالی نمایش داده شود.
Causes the tooltip to display at the coordinates of the last mouse message
wParam
lParam
The return value is not used
SetCursorPos 300, 300
SendMessageA hWndtoolTip,TTM_POPUP, 0,0
Private Const WM_SETCURSOR=&H20
Parameters
wParam
TTM_SETDELAYTIME = &H403
TTM_ADDTOOLA = &H404
TTM_RELAYEVENT = &H407
TTM_SETTOOLINFOA = &H409
TTM_HITTESTA = &H40A
TTM_UPDATETIPTEXTA = &H40C
TTM_WINDOWFROMPOINT := 0x410
TTM_TRACKACTIVATE = &H411
TTM_TRACKPOSITION = &H412
TTM_SETTIPBKCOLOR = &H413
TTM_SETTIPTEXTCOLOR = &H414
TTM_SETMAXTIPWIDTH = &H418
TTM_GETMAXTIPWIDTH = &H419
TTM_SETMARGIN = &H41A
TTM_POP = &H41C
TTM_UPDATE = &H41D
TTM_ADJUSTRECT = &H41F
TTM_SETTITLEA = &H420
TTM_SETTITLEW = &H421
TTM_POPUP = &H422
TTM_ADDTOOLW = &H432
TTM_SETTOOLINFOW = &H436
TTM_HITTESTW = &H437
TTM_GETTEXTW = &H438
TTM_UPDATETIPTEXTW = &H439
ChildWindowFromPoint hWndParent,Point
MapWindowPoints hWndFrom,hWndTo, lpPoints(Rect),cPoints(number of points
(POINT pt(2
MapWindowPoints hWnd1,hWnd2,pt(0), 1
MapWindowPoints(hWnd1,hWnd2,pt(1), 1
تغییر سایز Edit در پنجره
(hEdit=GetDlgItem(hDlg,IDC_EDIT
Dim rct As RECT
GetClientRect hEdit,rct
MapWindowPoints hEdit,hDlg,rct,1
MoveWindow hEdit,rct.left,rct.top, rct.right-40,rct.bottom
: OnCreate
(ti.cbSize = Len(ti
ti.uFlags =TTF_TRACK Or TTF_ABSOLUTE
ti.hwnd = hwndOwner
ti.uId = '(UINT)FIT_NLSF_EDIT_FUNC
ti.hinst =0
("ti.lpszText =TEXT("hello
ti.rect.left = 0
ti.rect.right = 0
ti.rect.bottom =0
ti.rect.top =0
SetRectEmpty ti.rect'
SendMessageA hwndTT,TTM_ADDTOOL, 0,ti
SendMessageA hwndTT,TTM_SETMAXTIPWIDTH,0,80
SendMessageA hwndTT,TTM_SETTIPBKCOLOR, RGB(247, 252, 203),0
SendMessageA hwndTT,TTM_SETTIPTEXTCOLOR, RGB(0, 0, 0),0
RetVal = SendMessage(hwndTT, TTM_UPDATETIPTEXTA, 0, ti)
SendMessageA hwndTT,TTM_TRACKACTIVATE,TRUE, ti
GetCursorPos pt 'get the cursor position
if WM_SETCURSOR Then
get the button rect'
GetWindowRect(GetDlgItem(hDlg, FIT_NLSF_SELECT_FUNC),rc1
if PtInRect(rc1, pt) Then
SendMessage hwndTT,TTM_TRACKPOSITION, 0,(LPARAM)MAKELPARAM(pt.x,pt.y)
TTM_POPUP message'
'Causes the tooltip to display at the coordinates of the' last mouse message.
SendMessage hwndTT,TTM_POPUP,0,0
Else
TTM_POP message'
Removes a displayed tooltip window from view'
SendMessage hwndTT,TTM_POP,0,0
End If
Re: TOOLTIP in win32
Tacking means that the tooltip will move with the mouse( it just explicitly send the TTM_TRACKPOSITION message to the tooltip window).
as for the handle of tooltip control window, I use the global static type. the parent window is not deconstructed.
ps,I think if I use the TTF_IDISHWND flag, then uId should be the handle to that control .
Thanks
tony
اگر درست باشد البته
Public Function MAKELPARAM(ByVal wLow As Long, ByVal wHigh As Long) As Long
(&MAKELPARAM=(wlow And &H7FFF
(&Or (&H10000 * (wHigh And &H7FFF
End Function