06-03-2011, 08:49 AM
Hey,
So I found Microsoft.WindowsAPICodePack.dll online and I started screwing with it. I found that you can add ThumbnailToolbarButtons to your process, just like WMP has.
This is what we are aiming for:
The .dll's: http://www.multiupload.com/FDKNSPL53Y
Okay i'm not going to tell every basic crap, I assume you know something about VB before doing this.
Step 1
Add the .dll's as reference.
Step 2
Import the following element: Microsoft.WindowsAPICodePack.Taskbar
Step 3
Declare the buttons you want, I did three(to show you guys how to add more then one button with only ONE line).
Step 4
Next, add the code which will add the buttons:
This will add all three buttons to your application, but now, how can we make it execute something on a click?
Step 5
Add this code:
If change:
to
It will execute only when the 2nd button is clicked.
Now you can add your code.
Enjoy
So I found Microsoft.WindowsAPICodePack.dll online and I started screwing with it. I found that you can add ThumbnailToolbarButtons to your process, just like WMP has.
This is what we are aiming for:
The .dll's: http://www.multiupload.com/FDKNSPL53Y
Okay i'm not going to tell every basic crap, I assume you know something about VB before doing this.
Step 1
Add the .dll's as reference.
Step 2
Import the following element: Microsoft.WindowsAPICodePack.Taskbar
Step 3
Declare the buttons you want, I did three(to show you guys how to add more then one button with only ONE line).
Code:
Dim WithEvents ttb_1 As New ThumbnailToolbarButton(Me.Icon, "Black Background")
Dim WithEvents ttb_2 As New ThumbnailToolbarButton(Me.Icon, "White Background")
Dim WithEvents ttb_3 As New ThumbnailToolbarButton(Me.Icon, "MessageBox")
Step 4
Next, add the code which will add the buttons:
Code:
Dim arr(0 To 2) As ThumbnailToolbarButton
arr(0) = ttb_1
arr(1) = ttb_2
arr(2) = ttb_3
TaskbarManager.Instance.ThumbnailToolbars.AddButtons(Me.Handle, arr)
This will add all three buttons to your application, but now, how can we make it execute something on a click?
Step 5
Add this code:
Code:
Sub ttb_1_click() Handles ttb_1.Click
End Sub
If change:
Code:
Handles ttb_1.Click
to
Code:
Handles ttb_2.Click
It will execute only when the 2nd button is clicked.
Now you can add your code.
Enjoy