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 Declare Function GetDesktopWindow Lib "user32" () As Long
Function StartDoc(DocName As String) As Long
Dim Scr_hDC As Long
Scr_hDC = GetDesktopWindow()
'change "Open" to "Explore" to bring up file explorer
StartDoc = ShellExecute(Scr_hDC, "Open", DocName, "", "C:\", 1)
End Function
例:
startdoc "http://ygyuan.go.163.com"
startdoc "Mailto:[email protected]"
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Function StartDoc(DocName As String) As Long
Dim Scr_hDC As Long
Scr_hDC = GetDesktopWindow()
'change "Open" to "Explore" to bring up file explorer
StartDoc = ShellExecute(Scr_hDC, "Open", DocName, "", "C:\", 1)
End Function
例:
startdoc "http://ygyuan.go.163.com"
startdoc "Mailto:[email protected]"
解决方案 »
- VB计时器问题,请各位指教一下?
- 常用的东西:例如从数据库中查询出EXCEL中所有已知姓名人员的身份证,大家一般是怎么作的?
- 解决水晶报表9打包的极佳工具:InstallShield Developer v8.02 免费版 [五星]
- 谁有控件DBGRID的安装程序
- 再问:数据库图片保存问题
- 过程函数可以是数组吗?
- Windows的传真功能或WinFax传真软件:发一个传真究竟如何收费?
- 送分的问题,还不开抢?
- progressbar的背景窗体为什么是透明?
- 关于传输软件(分数不够了)
- 谁知道{[北大青鸟]和印度的APTECH合办的教育中心}来者有分
- 在一ADO访问SQL数据库程序中,其中一句set cnnDB = new recordset 为什么总是报错?说是什么NEW什么来着,记不太清了。
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
Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
ShellExecute Me.hwnd, vbNullString, "open","http://www.sina.com.cn" vbNullString, "C:\", SW_SHOWNORMAL
End Sub