教程中国
PHOTOSHOP CS9.0中文版 MAYA 8.5 FOR WINDOWS Corel Painter v9.0 Flash MX2004 中文版 Illustrator cs2 中文版
VC++6.0含sp6 中英文版 VB6.0 +sp6 简体中文版 Borland Delphi 7汉化版 MSDN for vb6.0中文版 Visual Studio 2005简体
教程中国下属 文件存储共享专家BIBIDU.COM 提供大型软件,教材,源码,电影,音乐,图书等下载 更多精品请点此进入
  您目前所在位置: 教程中国 >> 编程基地 >> VB >> 打开一个直接到自己主页的浏览器 RSS订阅
打开一个直接到自己主页的浏览器
教程(视频,书籍)下载:  ASP.NET AutoCAD 数据库 C# ASP java photoshop 网页设计 delphi 3dmax Flash C++ VB 张孝祥 实例   更多请进入BIBIDU搜索
IT搜索引擎   
Opening a browser to your homepage
submitted by Dan Newsome
D&D Information Professionals, newsomed@earthlink.net
You can use code like the following to open a browser to your homepage. Modify filenames, paths, and URLs as necessary to match the values on your system.

Dim FileName As String, Dummy As String
Dim BrowserExec As String * 255
Dim RetVal As Long
Dim FileNumber As Integer
Const SW_SHOWNORMAL = 1 注释: Restores Window if Minimized or

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

Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" _
(ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As _
String) As Long
注释:<Code> ---------

BrowserExec = Space(255)
FileName = "C:\temphtm.HTM"

FileNumber = FreeFile() 注释: Get unused file number

Open FileName For Output As #FileNumber 注释: Create temp HTML file
Write #FileNumber, " <\HTML>" 注释: Output text
Close #FileNumber 注释: Close file

注释: Then find the application associated with it.
  RetVal = FindExecutable(FileName, Dummy, BrowserExec)
  BrowserExec = Trim$(BrowserExec)
  注释: If an application is found, launch it!
  If RetVal <= 32 Or IsEmpty(BrowserExec) Then 注释: Error

    Msgbox "Could not find a browser"

  Else
    RetVal = ShellExecute(frmMain.hwnd, "open", BrowserExec, _
      "www.myurl.com", Dummy, SW_SHOWNORMAL)
    If RetVal <= 32 Then 注释: Error
      Msgbox "Web Page not Opened"
    End If
  End If

Kill FileName 注释: delete temp HTML file

来源:upschool.cn
作者:
关键字:打开一,直接到自己主页,浏览器
发表日期:2006-12-20 17:29:15

网页显示有限 阅读全文请下载本文完整版WORD文档

上一篇:不声明任何东西   下一篇:保持对VB源代码的跟踪


2008-11-20 7:46:02
本文的相类似文章
  • 江民木马一扫光彻底解救浏览器
  • IE浏览器恶意修改防护大法
  • Apple Safari浏览器URI内存漏洞
  • IE浏览器存在本地目录枚举漏洞
  • 通过Web浏览器修改交换机参数
  • 彻底斩断伸向IE浏览器的黑手
  • 到底是谁控制了我们的浏览器?
  • IE浏览器完全控制
  • 建立你自己的浏览器-查看源文件
  • 建立你自己的浏览器-发送到FontPage
  • 在学习中进步 在进步中成长 教程中国相随您的成长之路
    华腾联合科技股份有限公司版权所有
    广告联系:Rosibo@163.com