你需要编写一个程序来完成这个任务。
你需要调用Windows的API。以下是制作标题栏更改程序的方法。
使用记事本创建一个文件,命名为SetText.bas,并将其存储在桌面上。
将以下内容粘贴到文件中。
Imports System
Imports System.Runtime.InteropServices
Imports Microsoft.Win32
Public Module MyApplication
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Sub Main()
On Error Resume Next
Dim CmdLine As String
Dim Ret as Long
Dim A() as String
Dim hwindows as long
CmdLine = Command()
If Left(CmdLine, 2) = "/?" Then
MsgBox("Usage:" & vbCrLf & vbCrLf & "ChangeTitleBar Oldname NewName")
Else
A = Split(CmdLine, Chr(34), -1, vbBinaryCompare)
hwindows = FindWindow(vbNullString, A(1))
Ret = SetWindowText(hwindows, A(3))
End If
End Sub
End Module
然后在命令提示符窗口中键入。
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\vbc.exe" /target:winexe /out:"%userprofile%\desktop\SetText.exe" "%userprofile%\desktop\settext.bas" /verbose
您的桌面上创建了一个名为settext.exe的程序。使用方法如下:
"%userprofile%\desktop\settext" "Untitled - Notepad" "A Renamed Notepad"