Consulting

Results 1 to 2 of 2

Thread: Unable to fill text box of a #32770 window [EXCEL-VBA]

  1. #1
    VBAX Newbie
    Joined
    Aug 2016
    Posts
    2
    Location

    Unable to fill text box of a #32770 window [EXCEL-VBA]

    Im trying to automate a windows api by using an excel-vba macro.


    When I open a #32770 window, Im able to obtain the textbox handle by doing this:


    HTML Code:
        Do
        DoEvents
        Loop Until FindWindow("#32770", "Abrir") > 0
         hd1 = FindWindow("#32770", "Abrir") 'La ventana resultante de abrir Open
        Do
        DoEvents
        Loop Until FindWindowEx(hd1, 0&, "ComboBoxEx32", vbNullString) > 0
         hd2 = FindWindowEx(hd1, 0&, "ComboBoxEx32", vbNullString) 'Cuadro de texto
        Do
        DoEvents
        Loop Until FindWindowEx(hd2, 0&, "ComboBox", vbNullString) > 0
         hd3 = FindWindowEx(hd2, 0&, "ComboBox", vbNullString) 'Cuadro de texto interno
        Do
        DoEvents
        Loop Until FindWindowEx(hd3, 0&, "Edit", vbNullString) > 0
         hd4 = FindWindowEx(hd3, 0&, "Edit", vbNullString) 'Edición de cuadro de texto
        'Without doing <Do> + <DoEvents> + <Loop Until> the handles return 0 (?)

    Look a pciture of my scene:


    NgZ5zPO.jpg


    Until here, everything is right. Even Im able to click any button of the 32770 with BM_CLICK. The problem comes when Im triying to send a string text to the "Edit" text box. I try all the posibilities:


    HTML Code:
        'Option 1: Call SendMessageByString(hd4, WM_SETTEXT, 0&, "TEST")
        'Option 2: SendMessageByString hd4, WM_SETTEXT, 0&, "TEST"
        'Option 3: Call SendMessage(hd4, WM_SETTEXT, 0&, "TEST")
        'Option 4: SendMessage hd4, WM_SETTEXT, 0&, "TEST
        ' I try with PostMessage to

    I dont know what the problem is. Any ideas?


    Thanks.

  2. #2
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    Be as you wish to seem

Tags for this Thread

Posting Permissions

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