Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I know I have seen several threads about this. Working on a program, I needed to achieve the same functionality so I hacked this little example together; I'm sure there's a better way but this works pretty well.

 

               System.Diagnostics.Process.Start("C:\\Documents and Settings\\Administrator\\My Documents\\Visual Studio 2005\\Projects\\eBay Search\\EbaySearch.exe")

               'while external program is running
               While bSkipDBCheck = True
                   'set program running to false (so we don't loop endlessly)
                   bSkipDBCheck = False
                   'for each process running
                   For Each x As System.Diagnostics.Process In System.Diagnostics.Process.GetProcesses()
                       'check current process
                       If x.ProcessName.ToString() = "EbaySearch" Then
                           'its the one we want to let finish so make sure we stay in the do loop
                           bSkipDBCheck = True
                       End If
                   Next
                   'don't freeze the computer
                   Application.DoEvents()
               End While
'Code to run after the external program has completed

 

I'll post a C# conversion sometime later on.

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...