Application Bar update - Clearer Icons

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
6 posts Page 1 of 1
Contributors
User avatar
imbeta
Site Admin
Site Admin
Posts: 12
Joined: Thu Jul 23, 2009 4:21 pm

Hi,

OK I have made a small modification to the Application Bar which shows your shortcut icons without the annoying shortcut arrow on top of it so now they look nice crisp and clear like this:

Image

It doesnt work on absolutely every icon though, shortcuts to like 'C:\' still show the arrow but im working on it.

OK to modify the code you need to find these 2 sections in the code:
Code: Select all
Try
Using ico As Icon = Drawing.Icon.ExtractAssociatedIcon(line)
Dim s = ico.ToBitmap
w.Image = s
End Using
Catch
w.BackColor = Color.Aqua
End Try
Thats repeated twice in the code you already have. You need to replace those sections with the following code:
Code: Select all
               Try
                    Dim shortcut, starget As String
                    Dim oshelllink
                    Dim wsh As Object = CreateObject("WScript.Shell")
                    wsh = CreateObject("WScript.Shell")
                    shortcut = filename
                    oshelllink = wsh.CreateShortcut(shortcut)
                    starget = oshelllink.TargetPath
                    Using ico As Icon = Drawing.Icon.ExtractAssociatedIcon(starget)
                        Dim s = ico.ToBitmap
                        w.Image = s
                    End Using
                Catch ex As Exception
                    Using ico As Icon = Drawing.Icon.ExtractAssociatedIcon(filename)
                        Dim s = ico.ToBitmap
                        w.Image = s
                    End Using
                End Try
And thats it :) . Compile and test it out. Any problems please let me know.
Im codenstuff.com...Im the moderator...iMBETA
User avatar
CodemaN
VIP Access - Denied
VIP Access - Denied
Posts: 74
Joined: Fri Sep 18, 2009 3:18 pm

clapper; clapper; clapper; clapper;
User avatar
Neki
Top Poster
Top Poster
Posts: 96
Joined: Sun Oct 11, 2009 10:12 am

On mine Vista, all works. Great program!
User avatar
bfh13
Just Registered
Just Registered
Posts: 5
Joined: Fri Jun 04, 2010 8:27 am

looks good, better than the shortcut look
User avatar
XTechVB
VIP - Site Partner
VIP - Site Partner
Posts: 727
Joined: Thu May 20, 2010 10:32 am

this is so cool
i have a question tough, Can you make the bar transparent but not the icons to
You can find me on Facebook or on Skype mihai_92b
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

nice
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
6 posts Page 1 of 1
Return to “Tutorials”