Yes, i can show tooltip for a button such as:
case WM_NOTIFY:
{
switch (((LPNMHDR) lParam)->code)
{
case TTN_NEEDTEXT:
{
LPTOOLTIPTEXT lptttext;
lptttext = (LPTOOLTIPTEXT) lParam;
lptttext->hinst = g_hInst;
switch(lptttext->hdr.idFrom)
{
case ID_BUTTON1:
{
lptttext->lpszText = L"Tooltip button 1";
}break;
}
}
}
}
break;
And the code below here show the selected text using message box (I create a procedure for rich edit controll)
LRESULT FAR PASCAL RichEditProc(HWND hWnd,
UINT Message,
WPARAM wParam,
LPARAM lParam)
{
wchar_t *wcWordSelect = new wchar_t[MAX_LENG_WORD];
switch(Message)
{
case WM_CHAR:
if ((wParam == VK_RETURN) || (wParam == VK_TAB))
{
return 0;
}
break;
case WM_RBUTTONDOWN:
{
SendMessage(hWnd, EM_GETSELTEXT, SCF_SELECTION, (LPARAM)wcWordSelect);
MessageBox(NULL, wcWordSelect, L"MSG", NULL);
CreateToolTipForRect(hWnd);
}
break;
case WM_KEYDOWN:
if (wParam == VK_RETURN)
{
SendMessage(hWnd, EM_GETSELTEXT, SCF_SELECTION, (LPARAM)wcWordSelect);
MessageBox(NULL, wcWordSelect, L"MSG", NULL);
return 0;
}
break ;
default:
break;
}
return CallWindowProc((WNDPROC)lpfnOldWndProc, hWnd, Message, wParam, lParam);
}
My QUESTION is: how can i use tooltip insted of using message box to show '
wcWordSelect' variable?
Thank for your help!!