News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

TOOLTIPTEXT be limited to show 80 characters only ?

Started by fushiyun, October 01, 2006, 04:18:56 PM

Previous topic - Next topic

fushiyun

i am programing tooltip control.
but, i found that the tooltip window only can display 80 characters.
whether it can extend to 250 characters ?

the following struct be found in windows.inc.
but szText was limited at 80.
can anyone give me some suggestions ?
thank.


NMTTDISPINFO STRUCT
  hdr           NMHDR      <>
  lpszText    DWORD      ?
  szText      BYTE 80 dup (?)
  union
      hInst  dd  ?
      hinst dd ?
  ends
  uFlags       DWORD      ?
  lParam      LPARAM ?
NMTTDISPINFO ENDS

TOOLTIPTEXT  equ  <NMTTDISPINFO>

Tedd

If that's what it is, then I don't think you have the option to change it.
It is short because tooltips are only meant to be for short notification messges. And they only stay visible for a short time, so if the message is too long you won't have a change to read it all anyway.

Although.. (this is for the 'new' balloon style tooltips, so I'm not sure whether the same works for the 'old' type.)
QuoteNote that the text buffer specified by the szText member of the NMTTDISPINFO structure can accommodate only 80 characters. If you need to use a longer string, point the lpszText member of NMTTDISPINFO to a buffer containing the desired text.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/tooltip/usingtooltips.asp
No snowflake in an avalanche feels responsible.

sinsi

If you fill lpszText with a pointer to your >80 string, be aware of NMTTDISPINFO.hinst -
  if lpszText is a pointer, NMTTDISPINFO.hinst must be NULL
  else lpszText is the identifier of a string resource and NMTTDISPINFO.hinst is the program HINSTANCE.
Light travels faster than sound, that's why some people seem bright until you hear them.

ToutEnMasm

Hello,
Tooltips are not limited to 80 caracteres if you use a common control.
A full page is possible.
                          ToutEnMasm

mov       NewCommonStr.dwICC,ICC_COOL_CLASSES or ICC_USEREX_CLASSES or ICC_BAR_CLASSES or ICC_TAB_CLASSES or ICC_WIN95_CLASSES or ICC_LISTVIEW_CLASSES


invoke CreateWindowEx,WS_EX_TOPMOST,addr szToolTipClass,NULL,WS_POPUP or TTS_NOPREFIX or TTS_BALLOON,0,0,0,0,hWin,NULL,hInstance,NULL
mov    hToolTip,eax                   

PBrennick

ToutEnMasm,
I did not know that, that is very useful!  Can you put together a small example demonstrating this method?  This would be VERY helpful to me and others.

Thanks,
Paul
The GeneSys Project is available from:
The Repository or My crappy website

fushiyun

thank Tedd, sinsi, ToutEnMasm, and PBrennick with resply

fushiyun

thank Tedd, sinsi, ToutEnMasm, and PBrennick with replies.

i use lpszText to replace szText. now, it can work well. :bg

ToutEnMasm, common control ?
can you post a example for me, i think to study this. thank :U

ToutEnMasm

Hello,
This sample show how to create it and move it.
When you clic the buttons ,the tooltip made a square rotate around the window.
You can change the size of the window, the moves of the tooltip follow the changes.
                               
                                     ToutEnMasm


[attachment deleted by admin]

six_L

Hello,ToutEnMasm
could you change the tooltip window into transparent style?
regards

ToutEnMasm


This can surely be made.There is an article in msdn on "layered windows" if my memory is good.
Find it , and put the modifie sample here !.
                                  ToutEnMasm

six_L

regards

sinsi

Light travels faster than sound, that's why some people seem bright until you hear them.

six_L

Hello,sinsi
i saw the doc.
i can change the main window into transparent style. but the tooltip window always is failed.

regards