|
-
Feb 4th, 2011, 08:55 PM
#1
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.
-
Feb 4th, 2011, 09:48 PM
#2
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/
-
Feb 5th, 2011, 11:11 AM
#3
Re: Put your app in the tray or pin to task bar
-
Feb 7th, 2011, 04:50 PM
#4
Re: Put your app in the tray or pin to task bar
 Originally Posted by jmcilhinney
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...
-
Feb 7th, 2011, 05:10 PM
#5
Re: Put your app in the tray or pin to task bar
 Originally Posted by szlamany
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.
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
|