Coffeehouse Thread

8 posts

chrome not following the rules of windows 7 taskbar?

Back to Forum: Coffeehouse
  • User profile image
    Evok

    It may have changed and wouldn't  be a big deal then, but the last I remember is that no app is allowed to pin a shortcut on the taskbar, either during install or after. It was supposed to be the user themselves that do the pinning.

    I just installed chrome and noticed that it had somehow pinned itself to my taskbar. Considering I don't like chrome, and only use it to test compatability, I was upset to see that it had the ability to pin itself to my taskbar.

    Is this still the case? Again, if the taskbar team changed their tune on that and made it easy to pin apps through the API, then whatever...

  • User profile image
    Heywood_J

    Firefox started doing the same thing a while back.  Windows does not provide an official method for a program to pin itself to the taskbar, so Firefox and Chrome have to resort to some sort of hack to do it.

  • User profile image
    evildictait​or

    Does it add itself to the taskbar, or does it just replace the Internet Explorer icon?

  • User profile image
    Evok

    @evildictaitor: it was added to the taskbar

  • User profile image
    Heywood_J

    http://msdn.microsoft.com/en-us/library/dd391692%28VS.85%29.aspx

    "Note  Applications cannot programmatically pin themselves to the taskbar. That functionality is reserved strictly for the user."

     

     

  • User profile image
    AndyC

    Is it set as your default browser? I think Windows might auto create it in those circumstances.

  • User profile image
    evildictait​or

    , Heywood_J wrote

    Applications cannot programmatically pin themselves to the taskbar

    There is a difference between "cannot" and "shouldn't". It is possible:

    Option ExplicitDim ShellApp, FSO, DesktopSet ShellApp = CreateObject("Shell.Application")Set FSO = CreateObject("Scripting.FileSystemObject")Set Desktop = ShellApp.NameSpace("C:\Users\Bill\Desktop")Dim LnkFileLnkFile = Desktop.Self.Path&"\MyAwesomeApp.lnk"If(FSO.FileExists(LnkFile)) ThenDim tmp, verbDim desktopImtes, itemSet desktopImtes = Desktop.Items()For Each item in desktopImtesIf (item.Name = "ScheduleNotifier") ThenFor Each verb in item.VerbsIf (verb.Name = "Pin to Tas&kbar") Thenverb.DoItEnd IfNextEnd IfNextEnd IfSet FSO = NothingSet ShellApp = Nothing

    EDIT: Once again C9 makes it impossible to paste code sensibly. This site is seriously broken.

  • User profile image
    JoshRoss

    Option Explicit
    Dim ShellApp, FSO, DesktopSet 
    Set ShellApp = CreateObject("Shell.Application")
    Set FSO = CreateObject("Scripting.FileSystemObject")
    Set Desktop = ShellApp.NameSpace("C:\Users\Bill\Desktop")
    
    Dim LnkFileLnkFile = Desktop.Self.Path&"\MyAwesomeApp.lnk"
    
    If(FSO.FileExists(LnkFile)) Then
     Dim tmp, verb
     Dim desktopImtes, item
     Set desktopImtes = Desktop.Items()
     For Each item in desktopImtes
      If (item.Name = "ScheduleNotifier") Then
       For Each verb in item.Verbs
        If (verb.Name = "Pin to Tas&kbar") Then
         verb.DoIt
        End If
       Next
      End If
     Next
    End If
    Set FSO = Nothing
    Set ShellApp = Nothing
    

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.