-
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
-
use the ShellExecute API
That will execute any file with the associated program, look at MSDN (Online) for details.
Gerco.
-
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)
-