|
-
Nov 27th, 2008, 10:50 AM
#1
Thread Starter
Hyperactive Member
ReDim
Hi Guys
Will that work? I have This API:
Code:
Public Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
Public Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As Long) As Long
Public Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Type NOTIFYICONDATA
cbSize As Long
hWnd As Long
uID As Long
uFlags As Long
uCallbackMessage As Long
hIcon As Long
szTip As String * 128
dwState As Long
dwStateMask As Long
szInfo As String * 256
uTimeout As Long
szInfoTitle As String * 64
dwInfoFlags As Long
End Type
Because of the limitation of "szinfo as string 256" I need to be able to make szinfo with no limit. can ReDim it? if yes how can I do that?
Thanks
-
Nov 27th, 2008, 10:54 AM
#2
Re: ReDim
AFAIK you cant change it by simply, becuase the NOTIFYICONDATA have to be specified the string in the exact lenght, otherwise memory issues will occur.
-
Nov 27th, 2008, 06:25 PM
#3
Re: ReDim
 Originally Posted by wajdi
Because of the limitation of "szinfo as string 256" I need to be able to make szinfo with no limit. can ReDim it? if yes how can I do that?
Thanks
Per MSDN (great resource when needing to understand APIs), the szInfo structure is the balloon text and is limited to 256 characters, including, the null terminator. So really it is 255 characters worth of text. Setting it to > 256 should cause the API to read the structure incorrectly & I would expect a crash of the systray at worse. At best, only 255 characters used anyway -- just a guess there.
-
Nov 28th, 2008, 09:30 AM
#4
Thread Starter
Hyperactive Member
Re: ReDim
I guess there is no work around this, unless I have to use another alternative then the API, and szinfo, Maybe there is an OCX option that uses some kind of html. anyone knows of any alternative for balloon message then the API mentioned?
-
Nov 28th, 2008, 09:36 AM
#5
Re: ReDim
What are you trying to display in a ToolTip (balloon is still a tip) - book or something?
255 chars is more than enough - if you need to present large text then pop some form on the screen with multiline standard textbox or richtextbox.
-
Nov 29th, 2008, 07:31 AM
#6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|