vb调用shellexecute打开word文件,word一闪而过,何解?
Private Declare Function GetDesktopWindow Lib "user32" () As Long
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 MSHFlexGrid1_DblClick()
Dim doc_path As String
doc_path = App.path & "\kindsof" & "\" & Trim(MSHFlexGrid1.Text)
Dim scr_hDC As Long
scr_hDC = GetDesktopWindow
myprogram = ShellExecute(scr_hDC, "open", doc_path, "", "c:\", 1)
End Sub
另外奇怪的是,这段代码最初是可以运行的,后来我对窗体进行了一些修改就不能用了。请问是怎么回事?
因为比较急,所以分比较多。