vb怎么用默认的txt打开软件打开txt文件?
我系统默认关联的是notepad++ ,vb是一定要 Shell "notepad " 么? 为了软件的通用性我又不想shell个notepad++的路径
谢谢!
[解决办法]
使用api函数ShellExecute。
ShellExecute hwnd, "open", App.Path & "\24-.txt", vbNullString, vbNullString, 1
Private 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
'call:
ShellExecute Me.hwnd, "", strFile, "", "", 1