Results 1 to 2 of 2

Thread: Titlebar (caption)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2001
    Location
    Netherlands
    Posts
    25

    Question Titlebar (caption)

    Is it possible to edit the statusbar (caption) of a running application through the API?

  2. #2
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    Code:
          Option Explicit
          Private Declare Function FindWindowEx Lib "User32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    
          Private Declare Function SetWindowText Lib "User32" Alias "SetWindowTextA" (ByVal hWnd&, ByVal lpString$) As Boolean
    
          Function SetCaption(ByVal sWName As String) As Long
            Dim hWnd&
            hWnd = FindWindowEx(0&, 0&, vbNullString, sWName)
            If hWnd Then
              SetCaption = SetWindowText(hWnd, "Have a new caption why don't you..." & vbNullChar)
            Else
              SetCaption = 0
            End If
          End Function
    
    Private Sub Command1_Click()
      If SetCaption("Api Viewer") Then
        MsgBox "Caption Changed"
      Else
        MsgBox "Caption not changed"
      End If
    End Sub
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width