The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: fushiyun on October 01, 2006, 04:18:56 PM

Title: TOOLTIPTEXT be limited to show 80 characters only ?
Post by: fushiyun on October 01, 2006, 04:18:56 PM
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>
Title: Re: TOOLTIPTEXT be limited to show 80 characters only ?
Post by: Tedd on October 02, 2006, 11:42:40 AM
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
Title: Re: TOOLTIPTEXT be limited to show 80 characters only ?
Post by: sinsi on October 02, 2006, 12:31:40 PM
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.
Title: Re: TOOLTIPTEXT be limited to show 80 characters only ?
Post by: ToutEnMasm on October 02, 2006, 02:07:45 PM
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                   
Title: Re: TOOLTIPTEXT be limited to show 80 characters only ?
Post by: PBrennick on October 02, 2006, 02:42:49 PM
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
Title: Re: TOOLTIPTEXT be limited to show 80 characters only ?
Post by: fushiyun on October 03, 2006, 12:58:58 AM
thank Tedd, sinsi, ToutEnMasm, and PBrennick with resply
Title: Re: TOOLTIPTEXT be limited to show 80 characters only ?
Post by: fushiyun on October 03, 2006, 01:04:37 AM
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
Title: Re: TOOLTIPTEXT be limited to show 80 characters only ?
Post by: ToutEnMasm on October 03, 2006, 06:58:40 AM
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]
Title: Re: TOOLTIPTEXT be limited to show 80 characters only ?
Post by: six_L on October 03, 2006, 09:16:00 AM
Hello,ToutEnMasm
could you change the tooltip window into transparent style?
Title: Re: TOOLTIPTEXT be limited to show 80 characters only ?
Post by: ToutEnMasm on October 03, 2006, 06:26:33 PM

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
Title: Re: TOOLTIPTEXT be limited to show 80 characters only ?
Post by: six_L on October 04, 2006, 12:31:16 AM
Hey,ToutEnMasm
i'm trying,but i can't.
see the post( http://www.masm32.com/board/index.php?topic=4861.0 )
Title: Re: TOOLTIPTEXT be limited to show 80 characters only ?
Post by: sinsi on October 04, 2006, 01:53:17 AM
six_L, have a look at this:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/usingwindows.asp
Title: Re: TOOLTIPTEXT be limited to show 80 characters only ?
Post by: six_L on October 04, 2006, 02:41:07 AM
Hello,sinsi
i saw the doc.
i can change the main window into transparent style. but the tooltip window always is failed.