22.txt
来自「VB实用技巧124则之1-62则 为了使每包文件个数少于65(获得更快的解压速」· 文本 代码 · 共 47 行
TXT
47 行
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
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?