Results 1 to 21 of 21

Thread: System Tray Icon? [RESOLVED!]

  1. #1

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253

    System Tray Icon? [RESOLVED!]

    Yes i have searched, all results show "Unstable code"

    Does anybody know of "Reliable" code to minimize my app to the system tray and show an icon? Also if possible, seeming as im using the Smart Menu XP control, could i show a popup menu using this control when the icon is clicked?

    THANKS
    Last edited by Madboy; Dec 7th, 2003 at 04:28 PM.

  2. #2
    Hyperactive Member
    Join Date
    Nov 2003
    Location
    In Front of my computer...
    Posts
    367
    Hi Here you go
    Attached Files Attached Files
    Born to help others
    (If I've been helpful then please rate my post. Thanks)

    call me EJ or be slapped!

  3. #3

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    Thanks, it seems very buggy though. Like when you click the icon from the system tray, once the menu has been shown it doesnt show again.

    Thanks anyway, anybody else with "CLEAN SYSTEM TRAY ICON EXAMPLE"?

    Thanks!

  4. #4
    Hyperactive Member
    Join Date
    Nov 2003
    Location
    In Front of my computer...
    Posts
    367
    WORks good with me u need to click the left button not the right it will show always
    Born to help others
    (If I've been helpful then please rate my post. Thanks)

    call me EJ or be slapped!

  5. #5
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    probably want to set the menu to go up on WM_RBUTTONUP instead

    Case WM_RBUTTONUP :
    Me.PopupMenu mnuSystray
    End Select

  6. #6
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217

    Re: System Tray Icon?

    Originally posted by Madboy
    Yes i have searched, all results show "Unstable code"

    Does anybody know of "Reliable" code to minimize my app to the system tray and show an icon? Also if possible, seeming as im using the Smart Menu XP control, could i show a popup menu using this control when the icon is clicked?

    THANKS
    i really want to know how it is "unstable".

  7. #7

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    Thats the problem though i right clicked first, then tried left. Left showed the menu fine, but bugged up because i right clicked first. Maybe handle the right click of the icon is a good icon

  8. #8
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654
    I found this code from my archives. Seemed to work nice and smooth.
    Attached Files Attached Files

  9. #9

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    Thanks, that works nice merri

  10. #10
    Addicted Member
    Join Date
    Dec 2002
    Posts
    196
    Originally posted by Merri
    I found this code from my archives. Seemed to work nice and smooth.

    I've added this code to one of my apps and it works perfectly. On my other application, I can't get the form1_mousemove event to fire when my mouse is over the Tray Icon. That means, once I minimize the form to the tray, the popup menu will not popup since the form1_mousemove detects mousebuttons.

    -Brandon-
    Brandon S Davids

  11. #11
    Addicted Member Para80d's Avatar
    Join Date
    Oct 2003
    Location
    Denton, TX
    Posts
    160
    www.planet-source-code.com has a good example.
    C++/VB6&.NET/QBasic/HTML/PHP/MySQL/SQLServer2k

    I'm the guy your little brother looks a lot alike. Tell your mom i said thanks.

    naked in vegas

  12. #12
    Addicted Member
    Join Date
    Dec 2002
    Posts
    196
    They have a ton of examples. Do you know the URL or name of a good and stable one?

    The second systray.zip file, just above this post is very nice, but for some reason, it's not working in my application. Works perfect in a different one.

    -b-
    Brandon S Davids

  13. #13

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    PSC code is crap though

  14. #14
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654
    With the code I posted, you could try creating a picturebox named Systray and then change hWnd setting in Form_Activate to point to this picturebox instead of the form. Also move MouseMove events to this picturebox.

    Does it work? I don't have the time to try, I want to stay tightly with my current project...

  15. #15
    Addicted Member
    Join Date
    Dec 2002
    Posts
    196
    Works like a charm. You're the best.

    -b-
    Brandon S Davids

  16. #16

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    Alright for some, i couldnt get my XP Smart Menu to show in the system tray right click

  17. #17
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654
    I don't recommend using SmartMenuXP since it is unstable and manages to mess up in XP. I can't remember what caused it to crash every now and then, but I wasn't using it in any special way.

    I guess there are other ways to show cool menus... I'll do something for my current project once I'm more done with it (IRC client, four days passed, fully usable but requires fixing and adding more features before I can even dream about releasing it... uh, started talking too much again)

  18. #18

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    lol , seems stable here on my Win98 SE. What happens on XP with the Smart Menu? And is it on many XP systems or just yours?

  19. #19
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654
    When I still had the control, it didn't work correctly when XP used XP-style. Menu borders didn't show up right etc. etc. So the control doesn't support XP. Weird?

    And this was tested on three different installations of XP. Three can't be wrong

    Also, my app did a lot of manipulation to the menu and it didn't seem to handle it. Added and removed continuously items and so on.

  20. #20
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    Here's an example I wrote years back that supports dynamic menu's at runtime plus animated icons in the systray...

    http://www.vbforums.com/showthread.p...stray+and+woka

    However, the only problem with it is that it subclasses the form. This is not good practice, but for this purpose it works fine. I have other code that creates it's own msg window...will post that when I can find it.

    In fact it's on VBF somewhere. Do a search for Woka and vbTools

    Hope that helps,

    Woka

  21. #21
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    OK, here's an example that doesn';t reply on a from in the DLL.
    It creates it's own MsgHook and MsgWindow.

    Hope this helps.

    Oh, did I mention it allows for you to pass an imagelist to it and then animate the icon???

    Woka
    Attached Files Attached Files

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