Public Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long Public Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Public Sub SetTitle(ByVal hwnd As Long, Optional ByVal title As String) If title = "" Then title = "明经通道 http://www.mjtd.com" End If SetWindowText hwnd, title End Sub
Public Sub Test_SetTitle() Dim hwnd As Long '& hwnd = GetParent(GetParent(ThisDrawing.hwnd)) SetTitle hwnd, "Hello World!" End Sub |