欢迎来到Java学习网!
设为首页 | 加入收藏
当前位置: 首页 > 编程开发 > VB语言 >

首先,大家拖 两个 文本框控件 一个 按钮控件 出来!

Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const JAVA中文网 = &HC
Private Sub Command1_Click()
Dim 找标题 As Long
Dim 原标题名字 As String
Dim 新标题 As String
原标题名字 = Text1.Text
找标题 = FindWindow(vbNullString, 原标题名字)
If 找标题 = 0 Then
MsgBox "找不到此标题名!"
Exit Sub
End If
新标题 = Text2.Text
SendMessage 找标题, JAVA中文网, 0, ByVal 新标题
End Sub
'Text1输入原标题,Text2自己随便输入,然后按按钮,原标题就变成Text1的标题!

    相关教程
    推荐内容