Results 1 to 3 of 3

Thread: [RESOLVED] [2008] Open With, in Vista

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    675

    Resolved [RESOLVED] [2008] Open With, in Vista

    I've been using this in an XP environment without any problems to get the Open With dialog:
    Dim sei As New SHELLEXECUTEINFO
    Dim strFileName As String

    sei.cbSize = Len(sei)
    sei.hwnd = Me.Handle.ToInt32
    sei.lpVerb = "openas"
    sei.lpFile = strFileName
    sei.nShow = 2

    ShellExecuteEx(sei)

    But, when I try it in Vista Business with any file extension I get this:
    This file does not have a program associated with it for performing this action. Create an association in the Set Associations control panel.

    I went to that control panel, and gifs, for instance, definitely have a program associated.

    Has anyone encountered this problem? Does anyone know how to fix it?

    Thanks
    VB.Net 2008
    .Net Framework 2.0

    "Must you breathe? 'Cause I need heaven..."

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] Open With, in Vista

    try this:

    vb Code:
    1. Private Sub OpenWith(ByVal fileName As String)
    2.     Process.Start("RUNDLL32.EXE", "shell32.dll,OpenAs_RunDLL " & fileName)
    3. End Sub

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    675

    Re: [2008] Open With, in Vista

    Perfect, thanks.
    VB.Net 2008
    .Net Framework 2.0

    "Must you breathe? 'Cause I need heaven..."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width