how to transfer txt to another window

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
9 posts Page 1 of 1
Contributors
User avatar
pip
VIP - Donator
VIP - Donator
Posts: 156
Joined: Tue Jul 12, 2011 3:13 am

how to transfer txt to another window
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?
<a href="http://www.points2shop.com/s/xbox_point ... 5082"><img src="http://points2shop.com/images/promotion ... ricoxg.gif" border="0"/></a>
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

I myself haven't tried it, though I do know it is through command line arguments.
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
User avatar
comathi
Coding God
Coding God
Posts: 1242
Joined: Fri Mar 26, 2010 1:59 pm

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 :)
User avatar
pip
VIP - Donator
VIP - Donator
Posts: 156
Joined: Tue Jul 12, 2011 3:13 am

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 all
shell("\path to file\continued\program.exe")
"what code here for textbox1 and textbox2 to paste for launcher then click start"
<a href="http://www.points2shop.com/s/xbox_point ... 5082"><img src="http://points2shop.com/images/promotion ... ricoxg.gif" border="0"/></a>
User avatar
comathi
Coding God
Coding God
Posts: 1242
Joined: Fri Mar 26, 2010 1:59 pm

Using the code I posted, this is how it could be done:

First application:
Code: Select all
Process.Start("\path to file\continued\program.exe", username & ";" & password)
Second application:
Code: Select all
Dim 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.
User avatar
pip
VIP - Donator
VIP - Donator
Posts: 156
Joined: Tue Jul 12, 2011 3:13 am

comathi wrote:
Using the code I posted, this is how it could be done:

First application:
Code: Select all
Process.Start("\path to file\continued\program.exe", username & ";" & password)
Second application:
Code: Select all
Dim 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 all
Private 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
<a href="http://www.points2shop.com/s/xbox_point ... 5082"><img src="http://points2shop.com/images/promotion ... ricoxg.gif" border="0"/></a>
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

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.
User avatar
pip
VIP - Donator
VIP - Donator
Posts: 156
Joined: Tue Jul 12, 2011 3:13 am

#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.
<a href="http://www.points2shop.com/s/xbox_point ... 5082"><img src="http://points2shop.com/images/promotion ... ricoxg.gif" border="0"/></a>
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

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.
9 posts Page 1 of 1
Return to “Coding Help & Support”