Run a file using the default application.
'run program with default app
'demo uses text, bitmap and doc,
'but other extensions work as well.
filedialog "Open","*.txt;*.bmp;*.doc",filename$
if filename$="" then end
call ShellExecute 0, filename$,_SW_SHOWNA, "open"
end
Sub ShellExecute hWnd, file$, parameter, lpszOp$
' _SW_SHOWNA show normal
' _SW_HIDE hide window
' _SW_MINIMIZE minimize window
' lpszOp$ = "open" or "print"
lpszFile$ = file$
lpszDir$ = DefaultDir$
lpszParams$=""
CallDLL #shell32, "ShellExecuteA", hWnd As long,_
lpszOp$ As ptr,lpszFile$ As ptr,_
lpszParams$ As ptr,lpszDir$ As ptr,_
parameter As long, result As long
End Sub