查看: 1063|回复: 9
|
VB link 的问题
[复制链接]
|
|
VB link 的问题
我的VB 里的cmd不function, 我按了cmd本来会link去IE我的网页,可是我按它没反应。。。
谁可以给code我???
还有一个问题:
如何按了cmd run another .exe file。
谢谢。 |
|
|
|
|
|
|
|
发表于 6-3-2007 09:24 AM
|
显示全部楼层
|
|
|
|
|
|
|

楼主 |
发表于 6-3-2007 01:16 PM
|
显示全部楼层
Private Sub cmdWebSite_Click()
WebBrowser1.navigate ("http://chinese.cari.com.my")
End Sub |
|
|
|
|
|
|
|
发表于 8-3-2007 11:28 AM
|
显示全部楼层
|
|
|
|
|
|
|
发表于 8-3-2007 02:21 PM
|
显示全部楼层
回 如何按了cmd run another .exe file :
例子如下:
当我按一个 button(cmdButton1)后,我要开到 Paint program。
首先,declare 以下两个
Public Const PROCESS_QUERY_INFORMATION = &H400
Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
过后,
Private Sub cmdButton1_Click()
Dim slAppToRun As String
slAppToRun = C:\windows\system32\Mspaint.exe
AppID = OpenProcess(PROCESS_QUERY_INFORMATION, 1, Shell(slAppToRun, vbNormalFocus))
End Sub
这样就可以了。。。 |
|
|
|
|
|
|
|
发表于 8-3-2007 02:55 PM
|
显示全部楼层
回复 #5 雪儿与小鱼儿 的帖子
Private Sub cmdButton1_Click()
Dim slAppToRun As String
slAppToRun = C:\windows\system32\Mspaint.exe
AppID = OpenProcess(PROCESS_QUERY_INFORMATION, 1, Shell(slAppToRun, vbNormalFocus))
End Sub
红色这行没有quotation mark???
其实,可以用vb的build-in function shell,不需要调用WINAPI
- Private Sub Command1_Click()
- Shell "notepad.exe", vbNormalFocus
- End Sub
复制代码 |
|
|
|
|
|
|
|

楼主 |
发表于 9-3-2007 02:36 PM
|
显示全部楼层
|
|
|
|
|
|
|

楼主 |
发表于 9-3-2007 02:38 PM
|
显示全部楼层
回复 #4 goatstudio 的帖子
还不是很明白,可以给一个example吗?
我只要run IE 和set the address。 |
|
|
|
|
|
|
|
发表于 13-3-2007 10:28 AM
|
显示全部楼层
原帖由 ohoh 于 9-3-2007 02:38 PM 发表
还不是很明白,可以给一个example吗?
我只要run IE 和set the address。
我用的方法
- Public 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 ipDirectory As String, ByVal nShowCmd As Long) As Long
复制代码
要 run 的时候
- ShellExecute hWnd, "open", "http://google.com", vbNullString, vbNullString, conSwNormal
复制代码 |
|
|
|
|
|
|
|
发表于 13-3-2007 11:57 AM
|
显示全部楼层
|
|
|
|
|
|
| |
本周最热论坛帖子
|