Page 1 of 1
how to transfer txt to another window
Posted: Thu Jul 26, 2012 8:10 am
by pip
Hi i have yet more help needed i am using shell to open a exe but i want textbox1 and textbox2 to copy that data in the exe that opens how could i go about doing this?
Re: how to transfer txt to another window
Posted: Thu Jul 26, 2012 10:39 am
by zachman61
I myself haven't tried it, though I do know it is through command line arguments.
Re: how to transfer txt to another window
Posted: Thu Jul 26, 2012 10:47 am
by comathi
Tutorial about this a while ago:
viewtopic.php?f=38&t=7320
You could put both TextBoxes' value in the same String, and then use it as an array in the other program

Re: how to transfer txt to another window
Posted: Thu Jul 26, 2012 11:05 am
by pip
comathi wrote:Tutorial about this a while ago: viewtopic.php?f=38&t=7320
You could put both TextBoxes' value in the same String, and then use it as an array in the other program 
This is getting closer but not quiet i mean my exe is like a client like runescape or wizard101 or lol and wow so let's say i am making launcher like i am for lol i want textbox1 to fill user of lol and textbox2 to enter password on launch so like
Code: Select allshell("\path to file\continued\program.exe")
"what code here for textbox1 and textbox2 to paste for launcher then click start"
Re: how to transfer txt to another window
Posted: Thu Jul 26, 2012 11:32 am
by comathi
Using the code I posted, this is how it could be done:
First application:
Code: Select allProcess.Start("\path to file\continued\program.exe", username & ";" & password)
Second application:
Code: Select allDim msg As String = Command()
Dim commands() As String = msg.Split(";")
TextBox1.Text = commands(0)
TextBox2.Text = commands(1)
Note: the code for the second application could be placed in the Form_Load event.
Re: how to transfer txt to another window
Posted: Thu Jul 26, 2012 12:22 pm
by pip
comathi wrote:Using the code I posted, this is how it could be done:
First application:
Code: Select allProcess.Start("\path to file\continued\program.exe", username & ";" & password)
Second application:
Code: Select allDim msg As String = Command()
Dim commands() As String = msg.Split(";")
TextBox1.Text = commands(0)
TextBox2.Text = commands(1)
Note: the code for the second application could be placed in the Form_Load event.
oh ok i get error on username password it say like due to protection level something...
this is my code:
Code: Select allPrivate Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim msg As String = Command()
Dim commands() As String = msg.Split(";")
TextBox1.Text = commands(0)
TextBox2.Text = commands(1)
Shell("\ProgramData\KingsIsle Entertainment\Wizard101\Wizard101.exe", TextBox1.Text & ";" & TextBox2.Text)
End Sub
Re: how to transfer txt to another window
Posted: Thu Jul 26, 2012 8:12 pm
by mandai
If the program accepts command line arguments you could use those, otherwise you might need to set the text with other methods such as window messages.
Re: how to transfer txt to another window
Posted: Sun Jul 29, 2012 5:45 pm
by pip
#mandai
Can i have a example maybe like if what you loading is a client like a game launcher i want to take like wow or lol or wizard101 and make it as you type user and password in text boxes to transfer to that window and launch game.
Re: how to transfer txt to another window
Posted: Tue Jul 31, 2012 12:01 am
by mandai
I'm not familiar with those games but the code would depend on how the windows are designed and what controls are being used.
There is an example here that can set the text of a notepad window:
viewtopic.php?f=21&t=5727&p=43511#p43452
You can use EnumChildWindows to get a list of control handles from a window.