[.NET] Taskbar Manager | JumpList, ThumbNail -Buttons, -Clip, -Progress, -Icon - Printable Version
+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Taskbar Manager | JumpList, ThumbNail -Buttons, -Clip, -Progress, -Icon (/showthread.php?tid=4294201)
|
Taskbar Manager | JumpList, ThumbNail -Buttons, -Clip, -Progress, -Icon - ๖ۣۜXilluX - Jun 19, 2014
Hello Community,
Introduction
Do you always wanted to make something like this:
![[Image: f78422e1a46499fe023bfbc5a2e421ab.png]](https://i.gyazo.com/f78422e1a46499fe023bfbc5a2e421ab.png)
![[Image: 9aab8210e0674b6cf1c05135a71b277c.png]](https://i.gyazo.com/9aab8210e0674b6cf1c05135a71b277c.png)
Well I wanted to do it aswell and after some research I found the solution and I am going to share it with you!
Preperation
We need these 2 .dll files, download them and a reference to your project!
Then Import the TaskBar and the Shell Class. I have imported the Reflection and IO Class aswell, because we need them.
Code Imports Microsoft.WindowsAPICodePack.Taskbar
Imports Microsoft.WindowsAPICodePack.Shell
Imports System.Reflection
Imports System.IO
JumpList
The JumpList is basically the ContextMenu of the TaskBar, but with less features. It is still available, when the application is not ran.
So in this sample we will create a Link to a new Application Instance.
Code Private Sub Form1_Shown(sender As Object, e As EventArgs) Handles Me.Shown
Dim jplst As JumpList = JumpList.CreateJumpList()
jplst.ClearAllUserTasks()
Dim TaskLink As JumpListLink = New JumpListLink(Assembly.GetEntryAssembly().Location, "Create new Instance")
TaskLink.IconReference = New IconReference(Assembly.GetEntryAssembly().Location, 0)
jplst.AddUserTasks(TaskLink)
How it will look:
![[Image: 3aaef40d18a6cc8c87e8ff185c6d3242.png]](https://i.gyazo.com/3aaef40d18a6cc8c87e8ff185c6d3242.png)
You can create as many of this items as you want.
![[Image: e5b8613d53e3b1a37841df2bf4f400ff.png]](https://i.gyazo.com/e5b8613d53e3b1a37841df2bf4f400ff.png)
You can also add a Seperator for a better overview:
Code Dim sep As JumpListTask = New JumpListSeparator()
jplst.AddUserTasks(sep)
![[Image: d48e4882d503eb5092214b71833108d4.png]](https://i.gyazo.com/d48e4882d503eb5092214b71833108d4.png)
As you might notice all these items will be put under the "Aufgaben" or "Tasks", if you want to give that a costum name you need to create a new JumpListCustomCategory.
Code Dim category As JumpListCustomCategory = New JumpListCustomCategory("System Utilities")
Dim calculator As JumpListLink = New JumpListLink(Path.Combine(Environment.SystemDirectory, "calc.exe"), "Calculator")
calculator.IconReference = New IconReference(Path.Combine(Environment.SystemDirectory, "calc.exe"), 0)
category.AddJumpListItems(calculator)
jplst.AddCustomCategories(category)
jplst.Refresh()
![[Image: 7023281489a1877ce8bc43cf1146a999.png]](https://i.gyazo.com/7023281489a1877ce8bc43cf1146a999.png)
Thumbnail Buttons
With Thumbnail Buttons those little buttons at the bottom are meant.
![[Image: 95cf0d345ba452df731279290ce8ec94.png]](https://i.gyazo.com/95cf0d345ba452df731279290ce8ec94.png)
You can only add 7 Buttons, but that should be enough though.
Code Dim button As ThumbnailToolBarButton = New ThumbnailToolBarButton(New Icon("skype.ico", 16, 16), "Open Skype")
TaskbarManager.Instance.ThumbnailToolBars.AddButtons(Me.Handle, button)
AddHandler button.Click, AddressOf button_click
Code Sub button_click()
'Any Code Here
End Sub
![[Image: da8622d08f97d660c9c1778dea58e03e.png]](https://i.gyazo.com/da8622d08f97d660c9c1778dea58e03e.png)
Thumbnail Clip
You can change the region that will be shown as Thumbnail with this easy code:
Code TaskbarManager.Instance.TabbedThumbnail.SetThumbnailClip(Me.Handle, New Rectangle(0, 0, 50, 50))
NOTE: Since it needs the handle you can perfom this with any external application aswell.
Taskbar Progress
Well you can also make the litte rectangle in your Taskbar act like a progressbar. This is easy aswell:
Code Dim tbm As TaskbarManager = TaskbarManager.Instance
tbm.SetProgressValue(50, 100, Me.Handle)
tbm.SetProgressState(TaskbarProgressBarState.Normal)
It has different states to either make the progressbar color green, red or yellow, depending on abortion, pause etc.
![[Image: 86432d722b009a482de4537cea390e7c.png]](https://i.gyazo.com/86432d722b009a482de4537cea390e7c.png) ![[Image: 9e8f7b5c63a2af1fd5684309aaeeb7ba.png]](https://i.gyazo.com/9e8f7b5c63a2af1fd5684309aaeeb7ba.png) ![[Image: 3d0c076dc049737c95a2e7e16c44c443.png]](https://i.gyazo.com/3d0c076dc049737c95a2e7e16c44c443.png)
Taskbar Overlay Icon
In my eyes this is completely useless, but check it out yourself.
What it does:
--> ![[Image: f1548d65cc284912c4200b4a094b5178.png]](https://i.gyazo.com/f1548d65cc284912c4200b4a094b5178.png)
Code for this:
Code tbm.SetOverlayIcon(New Icon("C:\Users\Paul\Pictures\Germany.ico"), "")
I hope this Tutorial helped some people and please leave a post, it took me much time to find out how this works and then compile the Thread!
* - SIM-1847363 - Jun 19, 2014
I always wanted to know how skype did all of there cool taskbar features, well now i know thanks man HQ thread!
* - ๖ۣۜXilluX - Jun 19, 2014
(Jun 19, 2014 06:47 AM)sabre Wrote: Your copying skills for the progress bar are remarkable https://hackforums.net/showthread.php?tid=4271143 but other than that the overlay icon part was very useful.
Sorry for this I haven't looked through the Threads, if there is already the same or a similar one.
* - Only3 - Jun 19, 2014
i try it b4 but with no luck i have win7 64
maybe http://originaldll.com/file/microsoft.windowsapicodepack.dll/29294.html
"If you use a 64-bit version of Windows, you should also copy microsoft.windowsapicodepack.dll to C:\Windows\SysWOW64"
if any1 try it pls post if its work
* - ๖ۣۜXilluX - Jun 19, 2014
(Jun 19, 2014 07:25 AM)Only3 Wrote: i try it b4 but with no luck i have win7 64
maybe http://originaldll.com/file/microsoft.windowsapicodepack.dll/29294.html
"If you use a 64-bit version of Windows, you should also copy microsoft.windowsapicodepack.dll to C:\Windows\SysWOW64"
if any1 try it pls post if its work
I have Windows 8.1 64 bit and I do not need to put the file in that folder.
|