Results 1 to 5 of 5

Thread: Put your app in the tray or pin to task bar

  1. #1

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Put your app in the tray or pin to task bar

    How do you go about putting your app in the system tray or pinning to the task bar (as in Windows 7)?

    How do you become part of the right-click menu on the desktop or files - like you see various zip archive tools?
    Last edited by szlamany; Feb 4th, 2011 at 08:59 PM.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Put your app in the tray or pin to task bar

    Making your app appear in the system tray is a matter of adding a NotifyIcon component to your form, setting its Icon property and making it Visible. You can handle the Click and/or DoubleClick events of the icon as well as set its ContextMenuStrip, just like a control.

    Pinning a shortcut to the Task Bar is not something I've ever don in code but it's obviously a Windows 7-specific feature. As such, I would imagine that you'd use the Windows 7 API Code Pack.

    http://code.msdn.microsoft.com/WindowsAPICodePack

    That said, I didn't see mention of pinning when I glanced at that page. I've often wondered whether pinning to the Task Bar in Windows 7 uses the same underlying mechanism as the Quick Lauch tool bar in previous versions. That might be something to investigate.

    Adding your app to the Windows Explorer right-click menu is another thing I've never done. I believe it's something that's controlled by the Registry though.

    http://scottiestech.info/2009/11/15/...-context-menu/
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Put your app in the tray or pin to task bar

    Thank you for the links.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  4. #4

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Put your app in the tray or pin to task bar

    Quote Originally Posted by jmcilhinney View Post
    Pinning a shortcut to the Task Bar is not something I've ever don in code but it's obviously a Windows 7-specific feature. As such, I would imagine that you'd use the Windows 7 API Code Pack.
    I'm curious - if you use the win 7 api code pack do you have to have releases of the .exe that do and do not contain that code? Or do you detect the o/s you are on to have it handle this...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Put your app in the tray or pin to task bar

    Quote Originally Posted by szlamany View Post
    I'm curious - if you use the win 7 api code pack do you have to have releases of the .exe that do and do not contain that code? Or do you detect the o/s you are on to have it handle this...
    That's up to you. There are various applications around that say that they support specific operating systems. I'd think that putting all the functionality into a single version would be preferable, but if the differences are too pronounced then it may be messy to keep checking the OS version all the time. Even if you do have different versions for different OSes, you could still have a single set of source code. You could add conditional compilation blocks and then create multiple build configurations with different compilation constants.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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