0

I need to send a input value(string) to another application which runs on Citrix which is currently on foreground(Active window)

I have tried below links

  1. How do I get the title of the current active window using c#?

  2. How to send a string to other application including Microsoft Word

  3. I can't understand how to use SendMessage or PostMessage calls

  4. copy and paste option- but this did not work either

    Send clipboard text or key stroke to current active window

  5. tried the input simulator

    SendKeys alternative that works on Citrix

In 5th option ,the 2 nd suggested answer stated to update/modify the Inputsimulator application class but i added a nuget package in my application. so, how do i update it accordingly.

below is the code using Input simulator

 string co = "This is a test° This is a test° This is a test° This is a test°This is a test°This is a test°";
 WindowsInput.InputSimulator cc = new WindowsInput.InputSimulator();
 cc.Keyboard.TextEntry(co);

how can i send a string to citrix application?

Community
  • 1
  • 1
prasy
  • 250
  • 1
  • 14
  • What were the fail reasons for each try? For 1) f.e., what did you get back when calling GetActiveWindowTitle()? – wonko realtime Apr 27 '15 at 14:55
  • i was getting title of window which is active but error is sending values sendInput , sendMessage, sendKeys and Keyboard.textentry all of them are inserting some random numbers in active window. – prasy Apr 27 '15 at 14:59
  • well, i'd recommend to get more specific on the expectations, the observations and the stuff you tried to raise the probability to get answers. Anyway, about the nuget package, which is a different question and could/should maybe be split, i'd just take the pain, get rid of the installed nuget package ref, fetch the source of Inputsimulator, compile it yourself and add the freshly compiled assembly as a reference to your project so you can test and modify it properly. – wonko realtime Apr 27 '15 at 16:10

1 Answers1

0

I had a similar problem in an application i was designing and I used SendKey Events to get around this problem and it worked just fine. When I used Sendkeys it never worked properly but when I used SendKey events it got past the issue. I know sendkey events is used to send codes representing things that test can't like page down etc but I used it for all text sending as well.

here is an example of C# code for you to send a send key event

// Clicking Button1 causes a message box to appear.
private void Button1_Click(System.Object sender, System.EventArgs e)
{
    MessageBox.Show("Click here!");
}


// Use the SendKeys.Send method to raise the Button1 click event 
// and display the message box.
private void Form1_DoubleClick(object sender, System.EventArgs e)
{

    // Send the enter key; since the tab stop of Button1 is 0, this
    // will trigger the click event.


    SendKeys.Send("{ENTER}");
    // try putting your text in here and see if something like this solves your issue
}

Try going to this Reference for further understanding of SendKey events if you think you might need it and best of luck to you

Dexter Whelan
  • 414
  • 3
  • 15