Posted on 2011-10-29
Last Modified: 2012-06-21
Hi there. I need to know how to send a text to the game (window). Game is called Heroes Of Newerth.

Question by:AlexeyTimofeev
    LVL 10

    Expert Comment

    You have to make the application active first then use

    SendKeys.Send("Your Text here")

    full example can be found here

    Author Comment

    It is a game that uses DirectX. Does that change anything?

    Author Comment

    What I'm trying to do is.. my program is getting some information relevant to the player and when player types the command my program should respond by sending message to the actual game. as I said games name is Heroes Of Newerth. It uses DIRECTX. Program should be able to send that message when game is focused or even if it's not.
    LVL 10

    Accepted Solution

    I don't know this game , but I know you cannot send any information ( Text )  while the application is not focused ( unless the the application itself allow API calls, Which I  doubt ) ,
    in many cases you have to place the the application in certain place on your desktop and click inside the text box in the game itself then use sendkeys ,
    I ran into such a problem while I was trying to send some information to a JAVA application , and it is end up to use Autoit3 ( google for it )   + VB as well
    Autoit3 was used to make the JAVA application active and click on the place I want to insert text to , then VB will send the text .

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now