Results 1 to 4 of 4

Thread: invoking file association

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    6
    Say I'm building an explorer type control and I want to implement 'double-clicking' a file. So I've got the filename, is there an API call to invoke the file association, or do I have to get the info from the registry myself? I've started trying to code this, and the association info is kept all over the place, so it gets quite involved and I'd rather not bother.

    Thanks.

    fpitch

  2. #2
    Guest
    use the ShellExecute API

    That will execute any file with the associated program, look at MSDN (Online) for details.

    Gerco.

  3. #3
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    My EMail is : [email protected]


    Here Is The Code

    Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

    Public Const SW_SHOWNORMAL = 1

    To Call This Method Type.

    AppName="Notepad"
    startdir="c:\"

    retval = ShellExecute(0&, vbNullString, AppName, vbNullString, startdir, SW_SHOWNORMAL)

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    6
    thanks all

    works good

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