Results 1 to 3 of 3

Thread: Systray1 example crashes if uhooked next to End

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    4
    After fumbeling arround with the aspect of writing to the system tray I found your SYSTRAY1 example quite smooth and functional. However - one aspect that I thought would be relatively easy to incorporate was an "EXIT" - Not so.

    If "unhook" is run in one sub procedure and End is run in another then life is just fine. However, if I set it up to "unhook" and "End" all in the same sub procedure then it ends with such violence that VB vaporizes (VB5 by the way)

    I would really like to have an exit option on the System Tray popup menu - much smoother than re-0pening the main form and closing from there.

    Thoughts / comments / suggestions would really be appreciated.

    Thanks

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    This is a complete guess but try putting a DoEvents inbetween the unhooking and the end command, unhooking the form might take some processes in another thread to implicate and you're not releasing the thread long enough for that to take place.

    Or try not using the End Command at all, Dan Appleman says never to use the end command ever ever, especially when using API calls Try unloading all your forms instead.

  3. #3
    Addicted Member ZanM's Avatar
    Join Date
    Oct 1999
    Location
    The here and now.
    Posts
    191

    If you want i can

    send you the source and to an activeX I made to add and remove icons from the tray it doesn't use any subclassing so won't crash VB or anything else if you want it i need your e-mail
    Magiaus
    Visual Basic 6.0 SP5
    Visual C++ 6.0 SP5


    The only sovereign you can allow to rule you is reason.

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