954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

VB net process help

Hello

I am a total amatuer programmer. I mainly just build little apps that are mainly useful to me. So please be gentle.

I am currently working on a program that will paste text into a second program. The text will paste into several different fields automatically.

The problem I am running into is that I need my program to check for running processes(as the second app will already be running). I seem to have done this just fine. When I then need to "use" that process

I use myprocess.start()

This of course starts a second instance of the application in question.

How do I basically use a process that is running as if I used the command .start()?

Sorry if this is answered somewhere else. I have been searching everywhere.

Thanks

lion8420
Newbie Poster
8 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 
adam_k
Practically a Posting Shark
803 posts since Jun 2011
Reputation Points: 256
Solved Threads: 149
 

Thank you for the reply
I have read that article. I seem to be getting a reference to the proper process but I cant seem to activate so that I can paste text to it.

Code below

Dim cernerprocess() As Process
        Dim seperation As String


        cernerprocess = Process.GetProcessesByName("notepad")

        If cernerprocess.Length = 1 Then

            cernerprocess(0).WaitForInputIdle(1000)

            If cernerprocess(0).Responding Then
                seperation = vbNewLine & vbNewLine & "======TEST======" & vbNewLine & vbNewLine
                Clipboard.SetText(seperation)
                System.Windows.Forms.SendKeys.SendWait("^(v)")
                cernerprocess(0).WaitForInputIdle(1000)
            End If


        End If


This code works if I start a new instance of notepad using this
process.start command

lion8420
Newbie Poster
8 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

I think I found a solution!

Thanks!

lion8420
Newbie Poster
8 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

Nice one Adam_K. Please mark thread as solved if solution found

Netcode
Veteran Poster
1,021 posts since Jun 2009
Reputation Points: 43
Solved Threads: 67
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: