vb 修改窗体标题的示例代码

Option Explicit
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 Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Private Const WM_SETTEXT = &HC
Private Sub Command1_Click()
Dim wnd As Long
wnd = FindWindow(vbNullString, "目标窗体名称")
SetWindowText wnd, "新的名字写在这里"
End Sub


本文来自胡摘网[http://z.hackpro.cn],转载请标明出处:http://www.hackpro.cn/art/2734.html

posted @ 2011-06-10 21:30  superfans98  阅读(841)  评论(0编辑  收藏  举报