wieder ToolTip
-
bei der common controls habe ich fast immer Probleme in msdn !!!!!!!!!!!!!!
wie kann ich ein Multiline ToolTip haben? nur folgende code in meinem WinProc geht nicht:
case WM_NOTIFY: { switch (((LPNMHDR)lParam)->code) { case TTN_GETDISPINFO: LPNMTTDISPINFO pInfo = (LPNMTTDISPINFO)lParam; SendMessage(pInfo->hdr.hwndFrom, TTM_SETMAXTIPWIDTH, 0, 150); wcscpy_s(pInfo->szText, ARRAYSIZE(pInfo->szText), L"This\nis a very long text string " \ L"that must be broken into several lines."); break; } break; }soll ich ein handle von ToolTip geben? (nach InitCommonControlsEx(&iccex); )
-
Benutze einfach den lpszText member. Dort kannst Du beliebig lange Texte reingeben, während szText auf (glaube ich) 80 Zeichen begrenzt ist.
Eine neue Zeile erreicht Du mit "\r\n". Ein einfaches "\n" reicht nicht.
-
Welche WndProc ist das?
Wie hast Du das Tooltip Control angelegt?
-
Martin Richter schrieb:
Welche WndProc ist das?
ich habe kein dialog box benutzt, nur einfach ein button auf den client area testet. WndProc ist haupt-wndproc.
Martin Richter schrieb:
Wie hast Du das Tooltip Control angelegt?
ich will das Tooltip auf dem button anlegen, wie? nach der msdn habe ich keine Idee. (beim single-line Tooltip hab ich kein Problem auf "button" "static")
ich jetzt habe mein single-line Tooltip nur ein zeile Code hingefügt:
SendMessage(hwndTip, TTM_SETMAXTIPWIDTH, 0, (LPARAM)(LPTOOLINFO)&toolInfo);und zwischen "blabla" ein '\n' eingefügt, dann funktioniert es.
aber wozu brauche ich die "case WM_NOTIFY:"?
-
Mit WM_NOTIFY benachrichtigt Dich das Tooltip z.B. oder andere Controls.
-
WM_NOTIFY 》
Remarks
The standard SendMessage syntax shown on this page is somewhat misleading. The destination of the message must be the HWND of the parent of the control. This value can be obtained by using GetParent, as shown in the following example, where m_controlHwnd is the HWND of the control itself.alles klar. Vielen vielen Dank. und merry christmas.