Results 1 to 7 of 7
  1. #1
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default Injecting Virtual Commands?

    I've been toying around in the Robot class lately but I dislike how it takes over your entire computer to control your mouse and keyboard. I've been wondering what the method is called that injects virtual commands into a program without interrupting the use of the physical keyboard and mouse inputs.

    Basically if I had a Word document open, I could load my program and it would then type a message into Word. While it was typing in Word I would open up another program and start using it normally. I know its possible, but I don't know where to start looking to find more information about it because I don't have the name of this method.

    Any help would be appreciated.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default Re: Injecting Virtual Commands?

    Sorry, I misread the original question ...

    kind regards,

    Jos
    Last edited by JosAH; 03-07-2012 at 03:22 PM.
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default Re: Injecting Virtual Commands?

    Damn, got me excited over here that someone knew about this and was online. Haha, thanks for attempting JosAH.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Injecting Virtual Commands?

    It might be possible to write a VBA script to a temp file (with deleteOnExit) and then execute that temp file from your Java program. The VBA script would have to locate the running instance of winword.exe and interact with it (note: I don't know whether VBA can actually do that, but I think it's likely.)

    In pure Java it's not possible at all.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default Re: Injecting Virtual Commands?

    Hmm, any clue to what the actual method is called? I know I have to deal with process threads but that's such a broad term that Googling it results mostly in security exploit forums.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Injecting Virtual Commands?

    Try to find a VBA forum. Maybe on a Micorosoft site.

    I'll give you this for free though: once your VBA has a handle to the Word application, the rest is typical OOPS programming: calling methods (only they're called functions), assigning returned values and passing parameters.

    I know I've posted examples of using VBA from Java for less complicated matters, both here and on JavaRanch. See if you can find any, that'll give you an outline to work with.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  7. #7
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default Re: Injecting Virtual Commands?

    Ok, I'm slightly disappointed that Java doesn't have anything like this because I want to expand more on the different libraries of Java and this was definitely something I was interested in trying. I guess I can look at it half full though, I could then learn about how to make different languages interact with each other.

    Thanks guys, always helpful.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

Similar Threads

  1. [Virtual KeyBoard] - Anybody know ?
    By Matheus Leandro Ferreira in forum Advanced Java
    Replies: 1
    Last Post: 09-30-2009, 08:22 PM
  2. Virtual table?
    By kblackwell in forum New To Java
    Replies: 4
    Last Post: 01-31-2009, 10:54 PM
  3. Too many virtual Machine
    By davantmay in forum Java Applets
    Replies: 1
    Last Post: 07-06-2007, 10:53 PM
  4. Virtual Machine To Pda
    By Heather in forum Advanced Java
    Replies: 2
    Last Post: 06-30-2007, 03:11 PM
  5. C# Java Virtual Machine 1.0.1
    By levent in forum Java Software
    Replies: 0
    Last Post: 05-25-2007, 07:47 AM

Posting Permissions

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