Share via

Tooltip update text problem?

D.D.K-2637 966 Reputation points
2022-08-20T15:50:00.49+00:00

Hi,
after initializing the tooltip, can I use SetWindowPos?
The code I use is as follows:

auto x=::SendMessage(hwnd, TTM_TRACKPOSITION, (WPARAM)0,   
							(LPARAM)MAKELONG(rectTip.left, rectTip.top));  
  
x=::SendMessage(hwnd, TTM_TRACKACTIVATE, (WPARAM)TRUE, (LPARAM)&ti);  
  
SetWindowPos(hwnd, 0, 200, 300, 0, 0, SWP_NOSIZE);  
ti.lpszText = (LPTSTR)L"Update text content";  
x = SendMessage(hwnd, TTM_UPDATETIPTEXTW, 0, (LPARAM)&ti);  

my problem is:
after using TTM_UPDATETIPTEXTW, the tooltip didn't stay at the position by SetWindowPos but it reverted back to the position by TTM_Trackposition.

is there a way to setup tooltip base position by SetWindowPos ?

Thanks in advance.

Windows development | Windows API - Win32
Developer technologies | C++
Developer technologies | C++

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Castorix31 91,876 Reputation points
    2022-08-21T08:23:49.507+00:00

    When you send TTM_UPDATETIPTEXTW, the Tooltip calls again SetWindowPos...

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.