Page 1 of 2 12 LastLast
Results 1 to 40 of 50

Thread: Send message to a textbox:

  1. #1

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Send message to a textbox:

    Okay, so i have the handle of a every window that i need to use. How do i find a textbox on that window and send some text to it?

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Send message to a textbox:

    VB Code:
    1. Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
    2.     (ByVal hWndParent As Long, _
    3.      ByVal hWndChildAfter As Long, _
    4.      ByVal lpszClassName As String, _
    5.      ByVal lpszWindowText As String) _
    6.     As Long
    7.  
    8. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
    9.     (ByVal hWnd As Long, _
    10.      ByVal wMsg As Long, _
    11.      ByVal wParam As Long, _
    12.      ByRef lParam As Any) _
    13.     As Long
    14.  
    15. Private Const WM_SETTEXT        As Long = &HC
    16.  
    17. ' Find text box -----------------
    18. Dim hWndTextbox As Long
    19. hWndTextbox = FindWindowEx(hWndParent, 0&, [TextboxClassName], vbNullString)
    20. ' OR --
    21. hWndTextbox = FindWindowEx(hWndParent, 0&, vbNullString, [TextboxText])
    22.  
    23. ' Send it some text -------------
    24. SendMessage hWndTextbox, WM_SETTEXT, -1, ByVal CStr("Your text goes here")

  3. #3

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    thanks..but it isnt exactly working.
    VB Code:
    1. Private Sub Command_Click()
    2.     Dim i As Integer
    3.     For i = 0 To List.ListCount - 1
    4.     Dim hWndTextbox As Long
    5. hWndTextbox = FindWindowEx(Val(List.List(i)), 0&, "trillian display", vbNullString)
    6. SendMessage hWndTextbox, WM_SETTEXT, -1, ByVal CStr("Your text goes here")
    7.     Next i
    8. End Sub

    this listbox contains the hWnds from when i get them
    (It is being found, hwndtextbox does get a value)

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Send message to a textbox:

    Sorry, I had the SendMessage wrong, it should be
    VB Code:
    1. SendMessage hWndTextbox, WM_SETTEXT, [hl]0&[/hl], ByVal CStr("Your text goes here")

  5. #5

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    still not working with that : /

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Send message to a textbox:

    It works with Notepad. Are you sure you have the class name right? Remember it's case sensitive.

  7. #7

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    well actually. what ive discovered is this:
    when i open up Spy++ and look for the textbox, it has been changed from "trillian display" trillian display to "Your text goes here" trillian display

    Now, im not sure whats going on!
    But it seems that i have 2 textboxes on this form with the same name and same classname!How do i send a message to the other one?

  8. #8

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    yeah thats it, ive sent the message to the textbox that your not supposed to be able to write in i think..

  9. #9
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Send message to a textbox:

    Yeah that never really works
    To find the other one your gonna have to enumerate the child windows. Unfortunately since that uses a callback function there's no real way to tell when the enumeration has finished, so it's a bit hard to incorporate that into a function. I post an example in asec anyway.

  10. #10

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    yeah rofl : )
    hopefully that will work ^^

  11. #11
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Send message to a textbox:

    If you still the need help, check the application we stripped down for getting all the handles. It has the ability to place text in textboxes or change captions of command buttons etc...

  12. #12

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    did it really? how would i get to that option, ill just re-download it and find that function

  13. #13
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Send message to a textbox:

    Well for what its worth here's mine anyway.

    Paste this into a module (Needs to be .bas cos of the callback)
    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function EnumChildWindows Lib "user32" _
    4.     (ByVal hWndParent As Long, _
    5.      ByVal lpEnumFunc As Long, _
    6.      ByVal lParam As Long) _
    7.     As Long
    8.  
    9. Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" _
    10.     (ByVal hWnd As Long, _
    11.      ByVal lpClassName As String, _
    12.      ByVal nMaxCount As Long) _
    13.     As Long
    14.  
    15. Private mstrSearchClassName     As String
    16. Private mahWndChildWindows()    As Long
    17. '
    18.  
    19. Public Function FindChildWindows(ByVal hWndParent As Long, _
    20.                                  ByVal pstrChildClassName As String) _
    21.                                 As Long()
    22.                                
    23. ' Find all child windows of a particular class name
    24. ' IN: hWndParent:           Handle of the window in which to search
    25. ' IN: pstrChildClassName:   Class name to search for
    26. ' RETURNS: Array of Longs containing the handles to _
    27.            the child windows found
    28.            
    29.     ReDim mahWndChildWindows(0)
    30.     mstrSearchClassName = pstrChildClassName
    31.     EnumChildWindows hWndParent, AddressOf EnumChildProc, 0
    32.     FindChildWindows = mahWndChildWindows
    33. End Function
    34. '
    35.  
    36. Public Function EnumChildProc(ByVal hWnd As Long, _
    37.                               ByVal lParam As Long) _
    38.                              As Long
    39. Static sblnArrayHasZeroMember As Boolean
    40.     Dim strClassName    As String
    41.     Dim strWindowText   As String
    42.  
    43.     ' Get the class name of the child window
    44.     strClassName = Space(255)
    45.     GetClassName hWnd, strClassName, 255
    46.     strClassName = Trim$(Left$(strClassName, InStr(1, strClassName, vbNullChar) - 1))
    47.  
    48.     ' Is it what we're looking for?
    49.     If (strClassName = mstrSearchClassName) Then
    50.         ' Add it to the array
    51.         If (sblnArrayHasZeroMember) Then
    52.             ReDim Preserve mahWndChildWindows(UBound(mahWndChildWindows) + 1)
    53.             mahWndChildWindows(UBound(mahWndChildWindows)) = hWnd
    54.           Else
    55.             mahWndChildWindows(0) = hWnd
    56.             sblnArrayHasZeroMember = True
    57.         End If
    58.     End If
    59.  
    60.     ' Continue enumeration if possible
    61.     EnumChildProc = 1
    62. End Function
    Now use it like this:
    Code:
    array_of_hWnds = FindChildWindows(hWndParent, [Child Classname])
    Here's an example of using it, you need a listbox and a command box for this one. This will find the window handles of all the toolbars on the taskbar.
    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim i As Long, ahWndbuf() As Long
    3.     ahWndbuf = FindChildWindows(FindWindow("Shell_TrayWnd", vbNullString), "ToolbarWindow32")
    4.     For i = 0 To UBound(ahWndbuf)
    5.         List1.AddItem ahWndbuf(i)
    6.     Next i
    7. End Sub

    HTH

  14. #14

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    wow thanks penagate. I really appreciate it, but since last post ive figured it out with my own code. Im going to test both, see which one does better.

    thanks alot

  15. #15
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Send message to a textbox:

    No worries

    Can you post your code? if it doesnt use enumeration I'd like to see how you did it

  16. #16

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    man i gotta start over : (
    i deleted how i got the classes!!iugh

  17. #17
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Send message to a textbox:

    I know the feeling

  18. #18

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    got it this time, let me clean it up a bit

  19. #19

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    Okay here:
    In a form add a 2 command buttons, and a listbox

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Command_Click()
    4.     Dim i As Integer, Num As Long, myLong As Long
    5.         For i = 0 To List1.ListCount - 1
    6.     Num = (List1.List(i))
    7.      ICount = 1
    8.     myLong = EnumChildWindows(Num, AddressOf WndEnumChildProc, vbNullString)
    9.         Next i
    10. End Sub
    11.  
    12. Private Sub Command2_Click()
    13. On Error Resume Next
    14.     Dim myLong As Long
    15.     VCount = 1
    16.     myLong = EnumWindows(AddressOf WndEnumProc, List1)
    17.  
    18. End Sub

    In a module:

    VB Code:
    1. Option Explicit
    2. 'APIs : WHERE THE REAL POWER IS
    3. Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    4. Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
    5. Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
    6. Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Any) As Long
    7. Public Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
    8. Public Declare Function EnumChildWindows Lib "user32" (ByVal hwndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Any) As Long
    9.             'showing window
    10. Public Const WM_SETTEXT = &HC                   'Setting text of child window
    11. Public Const WM_GETTEXT = &HD                   'Getting text of child window
    12. Public Const WM_GETTEXTLENGTH = &HE
    13.  
    14. Public VCount As Integer, ICount As Integer
    15. Public SpyHwnd As Long
    16.  
    17. ''''''''''''''''''''''''
    18. Public Function WndEnumProc(ByVal hwnd As Long, ByVal lParam As ListView) As Long
    19.     Dim WText As String * 512
    20.     Dim bRet As Long, WLen As Long
    21.     Dim WClass As String * 50
    22.        
    23.     WLen = GetWindowTextLength(hwnd)
    24.     bRet = GetWindowText(hwnd, WText, WLen + 1)
    25.     GetClassName hwnd, WClass, 50
    26.  
    27.         If InStr(WClass, "icoPMsgAIM") Or InStr(WClass, "icoPMsgMSN") Or InStr(WClass, "icoPMsgYAHOO") Or InStr(WClass, "icoPMsgICQ") Then
    28.            Form1.List1.AddItem hwnd
    29.         End If
    30.    
    31.     WndEnumProc = 1
    32. End Function
    33.  
    34. ''''''''''''''''''''''''
    35. Public Function WndEnumChildProc(ByVal hwnd As Long, ByVal lParam As ListView) As Long
    36.     Dim bRet As Long
    37.     Dim myStr As String * 50
    38.  
    39.     bRet = GetClassName(hwnd, myStr, 50)
    40.     'if you want the text for only Edit class then use the if statement:
    41.     'If (Left(myStr, 4) = "Edit") Then
    42.     'lParam.Sorted = False
    43.  
    44.         If InStr(myStr, "trillian display") Then
    45.             MsgBox Str(hwnd)
    46.         End If
    47.   '''''''''MsgBox "HWND:" & Str(hwnd) & " " & "CLASSNAME:" & myStr & "TEXT:" & GetText(hwnd)
    48.    
    49.     ICount = ICount + 1
    50.  
    51.     'lParam.Sorted = True
    52.     'End If
    53.     WndEnumChildProc = 1
    54.  
    55. End Function
    56.  
    57. Function GetText(iHwnd As Long) As String
    58.     Dim Textlen As Long
    59.     Dim Text As String
    60.  
    61.     Textlen = SendMessage(iHwnd, WM_GETTEXTLENGTH, 0, 0)
    62.     If Textlen = 0 Then
    63.         GetText = ">No text for this class<"
    64.         Exit Function
    65.     End If
    66.     Textlen = Textlen + 1
    67.     Text = Space(Textlen)
    68.     Textlen = SendMessage(iHwnd, WM_GETTEXT, Textlen, ByVal Text)
    69.     'The 'ByVal' keyword is necessary or you'll get an invalid page fault
    70.     'and the app crashes, and takes VB with it.
    71.     GetText = Left(Text, Textlen)
    72.  
    73. End Function
    now im just going to send a message to each one

  20. #20
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Send message to a textbox:

    I see how it works, cool

  21. #21

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    Okay, im having trouble with sendmessage again
    VB Code:
    1. Option Explicit
    2. Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    3. Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
    4. Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
    5. Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Any) As Long
    6. Public Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
    7. Public Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Any) As Long
    8. Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
    9.     (ByVal hWndParent As Long, _
    10.      ByVal hWndChildAfter As Long, _
    11.      ByVal lpszClassName As String, _
    12.      ByVal lpszWindowText As String) _
    13.     As Long
    14.             'showing window
    15. Public Const WM_SETTEXT = &HC                   'Setting text of child window
    16. Public Const WM_GETTEXT = &HD                   'Getting text of child window
    17. Public Const WM_GETTEXTLENGTH = &HE
    18. Public i As Integer
    19. Public VCount As Integer, ICount As Integer
    20. Public SpyHwnd As Long, hWndTextbox As Long
    21.  
    22. ''''''''''''''''''''''''
    23. Public Function WndEnumProc(ByVal hWnd As Long, ByVal lParam As ListView) As Long
    24.     Dim WText As String * 512
    25.     Dim bRet As Long, WLen As Long
    26.     Dim WClass As String * 50
    27.        
    28.     WLen = GetWindowTextLength(hWnd)
    29.     bRet = GetWindowText(hWnd, WText, WLen + 1)
    30.     GetClassName hWnd, WClass, 50
    31.  
    32.         If InStr(WClass, "icoPMsgAIM") Or InStr(WClass, "icoPMsgMSN") Or InStr(WClass, "icoPMsgYAHOO") Or InStr(WClass, "icoPMsgICQ") Then
    33.            Form1.List1.AddItem hWnd
    34.         End If
    35.    
    36.     WndEnumProc = 1
    37. End Function
    38.  
    39. ''''''''''''''''''''''''
    40. Public Function WndEnumChildProc(ByVal hWnd As Long, ByVal lParam As ListView) As Long
    41.     Dim bRet As Long
    42.     Dim myStr As String * 50
    43.  
    44.     bRet = GetClassName(hWnd, myStr, 50)
    45.     'if you want the text for only Edit class then use the if statement:
    46.     'If (Left(myStr, 4) = "Edit") Then
    47.     'lParam.Sorted = False
    48.  
    49.         If InStr(myStr, "trillian display") Then
    50.        
    51.         [B][COLOR=Red]hWndTextbox = FindWindowEx(hWnd, 0&, "trillian display", vbNullString)[/COLOR][/B]
    52. ' OR --
    53.     'hWndTextbox = FindWindowEx(Form1.List1(i), 0&, vbNullString, [TextboxText])
    54.  
    55. ' Send it some text -------------
    56. SendMessage hWndTextbox, WM_SETTEXT, 0&, ByVal CStr("Your text goes here")            'MsgBox Str(hWnd)
    57.         End If
    58.   '''''''''MsgBox "HWND:" & Str(hwnd) & " " & "CLASSNAME:" & myStr & "TEXT:" & GetText(hwnd)
    59.    
    60.     ICount = ICount + 1
    61.  
    62.     'lParam.Sorted = True
    63.     'End If
    64.     WndEnumChildProc = 1
    65.  
    66. End Function
    67.  
    68. Function GetText(iHwnd As Long) As String
    69.     Dim Textlen As Long
    70.     Dim Text As String
    71.  
    72.     Textlen = SendMessage(iHwnd, WM_GETTEXTLENGTH, 0, 0)
    73.     If Textlen = 0 Then
    74.         GetText = ">No text for this class<"
    75.         Exit Function
    76.     End If
    77.     Textlen = Textlen + 1
    78.     Text = Space(Textlen)
    79.     Textlen = SendMessage(iHwnd, WM_GETTEXT, Textlen, ByVal Text)
    80.     'The 'ByVal' keyword is necessary or you'll get an invalid page fault
    81.     'and the app crashes, and takes VB with it.
    82.     GetText = Left(Text, Textlen)
    83.  
    84. End Function

    hwndtextbox isnt getting a value, what am i doing wrong?

    edit***i already have the hwnd

  22. #22
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Send message to a textbox:

    Well you're enumming through the child windows at that point, which means if you have successfully got to that line you have already found your textbox, therefore
    VB Code:
    1. hWndTextbox = hWnd

  23. #23

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    thankyou, that works!
    but it isnt sending the text to the textbox, but it does change its name in the SPY++ ??i dont understand whats going on

  24. #24

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    aha, its changing the textboxs Caption, not its text?

  25. #25

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    where are all the api gods??

  26. #26
    Fanatic Member
    Join Date
    Mar 2005
    Posts
    537

    Re: Send message to a textbox:

    Right here, ya'll. (I'm not really, but I am pretty good with FindWindow and SendMessage)

    I don't use Trillian, so I don't know any of the classnames, but I DO use AIM, so if you need to know anything about that PM me.

    BTW, Trillian has a security flaw, the flaw allows people (the people who know how to exploit it) to look through all of your files. Try Gaim.


    -Sir Loin

  27. #27

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    lol what are they going to do looking thru my files : )..i dont really care rofl..
    I have the classname right, but instead of sending the text to the textbox its sending the text to the textboxes caption?? im not sure how to explain, if you want a screenshot ill send one

  28. #28
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Send message to a textbox:

    That doesn't make sense, it changes the classname?

    Yep, a screenshot sounds good


    Has someone helped you? Then you can Rate their helpful post.

  29. #29

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    im not sure what its changing

    Before and after are the two pictures...
    if you want the code again ill post it
    Attached Images Attached Images   

  30. #30
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Send message to a textbox:

    Nothing seems to be changing so I guess the text isn't being set... But I doubt that the classname is changing... If you refresh Spy++ does it show "trillian display" or something else after you run the code? If you type something in and you try to get the text does it get it? Are you sure it's the right control you want?


    Has someone helped you? Then you can Rate their helpful post.

  31. #31

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    my bad. i uploaded the wrong second picture. here it is
    Attached Images Attached Images  

  32. #32
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Send message to a textbox:

    That's really odd... Sorry, but I have no clue


    Has someone helped you? Then you can Rate their helpful post.

  33. #33
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Send message to a textbox:

    Oh, wait, it changes the title of the trillian display control... Do a FindWindowEx on the trillian display for the classname "edit"... Maybe there is a textbox inside the trillian display control (like in a frame)?


    Has someone helped you? Then you can Rate their helpful post.

  34. #34

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    i dont really understand what you mean...

    can you explain what i should do a little more,or fix it in this rar for me..
    Attached Files Attached Files

  35. #35

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    like this?:
    VB Code:
    1. If InStr(myStr, "trillian display") Then
    2.        
    3.         hWndTextbox = hWnd
    4. ' OR --
    5.     'hWndTextbox = FindWindowEx(Form1.List1(i), hWnd, vbNullString, [TextboxText])
    6.  hWndTextbox = FindWindowEx(Form1.List1.List(i), 0&, "trillian display", vbNullString)
    7. ' Send it some text -------------
    8. SendMessage hWndTextbox, WM_SETTEXT, 0&, ByVal CStr("Hi SMarterchild")            'MsgBox Str(hWnd)
    it is returning something, but nothing is happening

  36. #36
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Send message to a textbox:

    Actually that wouldn't work now that I think of it again... If it had any child windows it would have a "+" sign beside it in Spy++

    My idea was that FindWindow gets you the hwnd of the main window and with FindWindowEx you can get the handle of a child in a specific window... In a child of a window, you can have another child. So I was thinking that maybe they had a textbox in the trillian display control of theirs and "edit" is the standard classname for a textbox (I think)... So doing a FindWindowEx with the hwnd of the trillian display and looking for a "edit" class, if there was a textbox as a child, you would get the handle of it.

    I hope I didn't mix you up

    But that won't work and I'm running out of ideas... Only other thing that comes to mind and is a completely other approach is SendKeys (or the keyb_event API)


    Has someone helped you? Then you can Rate their helpful post.

  37. #37
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Send message to a textbox:

    What I was thinking of (and it won't work) was this :

    VB Code:
    1. hWndTextbox = FindWindowEx(hWndTextbox, 0&, "edit", vbNullString)


    Has someone helped you? Then you can Rate their helpful post.

  38. #38

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    i cant believe it wont work, this seems like its all 100% right...im not really into sendkeys..but i guess as a last resort <_<...Is it possible it blocked access to it or something??

  39. #39
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Send message to a textbox:

    It's some sort of their own textbox I assume So it won't accept the same messages as the normal textbox that we're thinking of... I hope someone else can come up with something, although I'm afraid it's not possible...


    Has someone helped you? Then you can Rate their helpful post.

  40. #40

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Send message to a textbox:

    what other things would be plausible? like what arguments could i try and pass to it?

Page 1 of 2 12 LastLast

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