Results 1 to 6 of 6

Thread: ReDim

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    507

    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

  2. #2
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    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.

  3. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: ReDim

    Quote 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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    507

    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?

  5. #5

  6. #6
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Re: ReDim

    http://planetsourcecode.com/vb/scrip...35572&lngWId=1

    Or, try this. Great example, easy to use.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width