我有一eprj檔案,是要用PG4UW應用程式來打開的,怎么通過對話框CommonDialog1來打開。是用shellexecute,能教下嗎
比如PG4UW應用程式路徑為D:\PG4UW.exe
需要打開的eprj檔案路徑:E:1.eprj
這個shellexecute怎么寫。謝謝 。已經對該eprj檔案的打開方式用PGUW進行了關聯
uj5u.com熱心網友回復:
如果那個程式支持命令列引數,用VB6的Shell就行,不必用API;如果它不支持,你用ShellExecute()恐怕也不起作用。
試下用這個:
Shell "D:\pg4uw.exe e:\1.eprj", vbnormalocus
uj5u.com熱心網友回復:
最后那個引數少了一個字母。
vbnormalfocus
也許這個也沒輸對,反正你在IDE中輸代碼時,它有引數串列提示,你找“最像”這個的引數就行了。
uj5u.com熱心網友回復:
[code=vb'在設計時按 ctrl+ t 鍵, 勾選 microsoft Common Dialog control (sp6) 確定 ,向表單添加'一個commondialong控制元件
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
Private Sub Form_Load()
CommonDialog1.ShowOpen
ShellExecute 0, "open", CommonDialog1.FileName, "", "", 5
End Sub][/code]
uj5u.com熱心網友回復:
'在設計時按 ctrl+ t 鍵, 勾選 microsoft Common Dialog control (sp6) 確定 ,向表單添加
'一個commondialong控制元件
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
Private Sub Form_Load()
CommonDialog1.ShowOpen
ShellExecute 0, "open", CommonDialog1.FileName, "", "", 5
End Sub
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/92482.html
標籤:VB基礎類
