CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14

Threaded View

  1. #1
    Join Date
    Jun 2008
    Location
    greater Cincinnati
    Posts
    54

    Question How do I manipulate a text box from a remote process ?

    Hello, and good day to everyone.

    Please excuse my ignorance. I am a novice C++ programmer, and I have 0 experience with Java.
     
    ----------------------------------------------------------------------------------------------------------------------------------
    I am trying to edit a text box of a program from another application. The program that contains the edit box is written in Java.

    I do not have the source for the program but I do have compiled classes though.

    I actually have already started a thread in the "C++ and WinAPI" forum querying different possible solutions to my problem, but I received no answer. I am posting in this forum to see if there are any Java specific resolutions.

    I have also read these two very old threads:

    Enumerate child windows
    Hooking into Java Application
     
    The latter thread seems to express that the only way to accomplish this task is by using Spy++, and home in on the messages pertaining to the window of interest. I have been trying this approach, and I've filtered through each of the various messages, but still I can't seem to pinpoint any messages that pertain to just that one textbox. I don't totally know what I am doing though.

    The former thread points out two routes to a possible solution.


    Norm mentions there are Swing methods to get all the components that are in one of those windows. But I don't know if after having retrieved a window's text box components how viable it would then be to manipulate the text using that component.



    dlorde seem to describe that RMI (Remote Method Invocation) could possibly be used to manipulate various controls within a remote Java application.




    remkop described a window class that seemed like it could do the job:

    Quote Originally Posted by remkop View Post
    The java.awt.Window class has several method that may be useful:
    static Window[] getWindows() - Returns an array of all Windows, both owned and ownerless
    static Window[] getOwnerlessWindows() - Returns an array of all Windows created by this application that have no owner.
    Window getOwner() - Returns the owner of this window.
    Window[] getOwnedWindows() - Returns an array containing all the windows this window currently owns.

    =================================================QUESTIONS============================================
    Q1) Is there a Java specific way to get some kind of handle or reference to the afore mentioned text box that would enable me to send text to it ?
    -------- I am hoping for something that is as easy to use as the Win32 " EnumWindows() " function, but I'll take anything. If you know of - any - way to accomplish this task I would like to hear that too.

    Q2) Do you think that any of the ways mentioned above could work for me?
    ------I am asking this because RMI and Java are very new to me, and I don't want to waste an enormous amount of time barkin' up the wrong tree.

    Q3) If there is no reasonable way to manipulate controls in a remote Java application then how in the world do Java programmers deal with such a task?


    Thanks for your invaluable time.
    Last edited by kmkkra; May 30th, 2011 at 06:50 PM.

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

Featured