Results 1 to 3 of 3

Thread: change a windowtext

  1. #1
    d3graph
    Guest

    change a windowtext

    i have a application which
    has a disabled textbox and text in it
    i want to change the text with
    another application ? how to do it

  2. #2
    Megatron
    Guest
    Send the WM_SETTEXT message to it.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. 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
    2. Private Declare Function SetWindowText Lib "User32" Alias "SetWindowTextA" (ByVal hWnd&, ByVal lpString$) As Boolean
    3.  
    4. Private Function SetCaption(ByVal WindowName As String) As Long
    5.         Dim hWnd As Long
    6.         hWnd = FindWindowEx(0&, 0&, vbNullString, WindowName)
    7.         If hWnd Then
    8.           SetCaption = SetWindowText(hWnd, "Have a new caption why don't you..." & vbNullChar)
    9.         Else
    10.           SetCaption = 0
    11.         End If
    12.  End Function
    13.  
    14. 'Usage:
    15. Call SetCaption("Current Caption")
    16. 'Where Current Caption is the actual caption of the running application

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