VB或VC编写-怎样隐藏或打乱其他窗体的标题字样-的代码
来源:百度知道 编辑:UC知道 时间:2024/07/08 18:32:47
这段代码能把系统自带记事本的标题("无标题 - 记事本")改成“hello”
你可以先打开记事本,然后运行程序测试一下,
要想改变杀软的标题吧"无标题 - 记事本"该成杀软的标题,“hello”改成你想要的字符
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 WM_SETTEXT = &HC
Private Sub Command1_Click()
Dim WindowHandle As Long
WindowHandle = FindWindow(vbNullString, "无标题 - 记事本")
SendMessage WindowHandle, WM_SETTEXT, 0, ByVal CStr("hello") '发送hello消息
End Sub
VB的
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Any, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowText Lib &quo