displayed view icon does not change with file association change...

When I first implemented the code attached, it worked perfectly, and my default image editor icon (Paint Shop Pro)'s icon was displayed just as I wanted.   However, as a test I changed the file associations so gif files will be edited with Paint, but no matter what I do, even to the point of rebooting the computer, the icon for Paint Shop Pro is still the one displayed.

What am I missing?


Public Function SetEditorIcon(ByRef lex As LastException) As Boolean
        Dim ls_dir As String = Nothing
        Dim fsavedfilename As String
        Dim editoricon As System.Drawing.Icon
        Dim retval As Boolean = True

        Try

        
            fsavedfilename = System.Configuration.ConfigurationManager.AppSettings("UserFormPageDirectory") & "temp.gif"
            If System.IO.File.Exists(fsavedfilename) Then
                System.IO.File.Delete(fsavedfilename)
                Application.DoEvents()
            End If
            If Not System.IO.File.Exists(fsavedfilename) Then
                System.IO.File.Create(fsavedfilename)
                Application.DoEvents()
            End If

            editoricon = System.Drawing.Icon.ExtractAssociatedIcon(fsavedfilename)

            frm.ToolStripButtonEdit.Image = Nothing

            frm.ToolStripButtonEdit.Image = editoricon.ToBitmap

        Catch ex As Exception

            retval = False
            lex.Message = ex.Message
            If Not ex.InnerException Is Nothing Then
                lex.Detail = ex.InnerException.Message
            End If
            lex.Source = "FormManagerCtrl - SetEditorIcon"
            lex.Code = "System Exception"


        End Try


        Return retval

    End Function

Open in new window

codefingerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

codefingerAuthor Commented:
Hmmmm....I am not sure if I completely changed the the file associations.  Viewed in Windows Explorer, my temporary gif file still says it is a Paint Shop Pro Image, so maybe the problem is not entirely in the code.

0
CodeCruiserCommented:
Try the paint shop pro settings to dis-associate it from GIF files and try again.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
codefingerAuthor Commented:
He shoots,  he scores!   Thanks!
0
CodeCruiserCommented:
Glad to help :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.