Simple Software Solutions
Hi
Another approach you could take that works for me is to present the user with a list of files in a list box or some other control.
Then when the user double-clicks on a file the following code is executed
nDT = GetDesktopWindow()
nApp = ShellExecute(nDT, "Open", strFile, "", "C:\", SW_SHOWNORMAL)
DoEvents
Where strFile is the name of the file to open
the GetDesktopWindow() is an API which is shown below
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpszOp As String, _
ByVal lpszFile As String, ByVal lpszParams As String, _
ByVal LpszDir As String, ByVal FsShowCmd As Long) _
As Long
Private Declare Function GetDesktopWindow Lib "User32" () As Long
Const SW_SHOWNORMAL = 1
Place this in the declarations section of the forms code
and call the ShellExecute on the double click of the file name
How you get the files into the list is your preferred method.
Code Master
