Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > API > Need more characters for ToolTip of SysTray Icon


Reply
 
Thread Tools Display Modes
  #1  
Old 06-01-2012, 03:30 PM
geo1st487's Avatar
geo1st487 geo1st487 is offline
Junior Contributor
 
Join Date: Oct 2002
Posts: 328
Default Need more characters for ToolTip of SysTray Icon


Hi! I use the following code for make a SysTray icon but i have a problem. The text of ToolTip size is only 64 chars length but i need more. I tried to change the szTip As String * 64 to szTip As String * 128 but I get the same result. I have seen many applications which the ToolTip text of SysTray icon has more than 64 chars. How do that?
Thanks


Code:
Public Declare Function Shell_NotifyIcon Lib _
"shell32.dll" Alias "Shell_NotifyIconA" _
(ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long

Public Const NIM_ADD = &H0
Public Const NIM_DELETE = &H2
Public Const NIM_MODIFY = &H1
Public Const NIF_ICON = &H2
Public Const NIF_MESSAGE = &H1
Public Const NIF_TIP = &H4
Public Const WM_MBUTTONDBLCLK = &H209
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_MOUSEMOVE = &H200
Public Const WM_RBUTTONDBLCLK = &H206
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP = &H205

Public Type NOTIFYICONDATA
    cbSize As Long
    hwnd As Long
    uID As Long
    uFlags As Long
    uCallbackMessage As Long
    hIcon As Long
    szTip As String * 64
End Type
Reply With Quote
  #2  
Old 06-01-2012, 04:09 PM
Cerian Knight's Avatar
Cerian Knight Cerian Knight is offline
Multi-Technologist

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 3,751
Default

Have you tried breaking the text with vbCrLf?
__________________
"May the code that you write never work in ways that you didn't expect; and may the code that you didn't write never require you to maintain it". - Ancient Chinese Proverb
Reply With Quote
  #3  
Old 06-01-2012, 06:43 PM
hDC_0 hDC_0 is offline
Contributor

* Expert *
 
Join Date: Feb 2004
Posts: 522
Default extended tooltip

Have you looked at this Stackoverflow post:
"How can I show a systray tooltip longer than 63 chars?"
Reply With Quote
  #4  
Old 06-02-2012, 05:03 AM
geo1st487's Avatar
geo1st487 geo1st487 is offline
Junior Contributor
 
Join Date: Oct 2002
Posts: 328
Default

Quote:
Originally Posted by Cerian Knight View Post
Have you tried breaking the text with vbCrLf?
I have tried but I get the same result.
Reply With Quote
  #5  
Old 06-02-2012, 05:11 AM
geo1st487's Avatar
geo1st487 geo1st487 is offline
Junior Contributor
 
Join Date: Oct 2002
Posts: 328
Default

Quote:
Originally Posted by hDC_0 View Post
Have you looked at this Stackoverflow post:
"How can I show a systray tooltip longer than 63 chars?"
I have seen the code from Stackoverflow post but is for C#

Microsoft say for the member szTip the below

"A null-terminated string that specifies the text for a standard tooltip. It can have a maximum of 64 characters, including the terminating null character.
For Windows 2000 and later, szTip can have a maximum of 128 characters, including the terminating null character."

The link
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

So I have windows vista, how do i make the szTip 128 characters length?
Thanks
Reply With Quote
  #6  
Old 06-02-2012, 09:27 AM
Cerian Knight's Avatar
Cerian Knight Cerian Knight is offline
Multi-Technologist

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 3,751
Default

Try passing a byte array containing ASCII instead of a string. That should get 128 characters to show.
__________________
"May the code that you write never work in ways that you didn't expect; and may the code that you didn't write never require you to maintain it". - Ancient Chinese Proverb
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->