Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27501

VB 2005: Bringing another application to the forward and sending text

$
0
0
I'm trying to make a function that will allow a user to have their web browser (for me it's waterfox) open at the same time as the application, and using a textbox interface, will allow their keystrokes to go to the web browser.

If you're wondering what purpose this would serve, it's a scoreboard application for an in-browser game that has a chat function, so the goal is the be able to use the ingame chat function without having to click away from the scoreboard application.

Here is what i have as of now:

Code:

Private Sub txtchat_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtchat.TextChanged
        Dim a As New Process

        a.StartInfo.FileName = "C:\Program Files\Waterfox\waterfox.exe"
        a.Start()
        Thread.Sleep(10000)
        SendKeys.Send("{TAB}")
        SendKeys.Send("test")
        SendKeys.Send("{ENTER}")

    End Sub

The TAB function is the keybinding to enable chat, and then ENTER to send it to the server. The above code does work, but that will open up a NEW browsing window and then type a predetermined text value. What my end goal is to have it send the text that is typed into the textbox to the already opened browsing window that has the game.

Viewing all articles
Browse latest Browse all 27501

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>