Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21690

[RESOLVED] Question about shelling two applications

$
0
0
I have a program that Shell's an application two times so that both apps run at the same time. I have the handle of each app in myWnd1 and myWnd2 variables as shown in the code below.

My question is knowing the handle of each app is there a way to know which app is the active app at any given time? For example, after both apps have been shelled and then the second app (it's handle in myWnd2) does something; can I tell if the action came from that app as opposed to coming from the first app that was shelled.

Code:

  '
  '
Private Sub LoadClient1()
 Dim Path As String
 
 Path = App.Path & "\Client.exe"

 Shell Chr(34) & Path & Chr(34), vbMinimizedNoFocus

 myWnd1 = FindWindow("ThunderRT6FormDC", "Form1")
End Sub

Private Sub LoadClient2()
 Dim Path As String
 
 Path = App.Path & "\Client.exe"

 Shell Chr(34) & Path & Chr(34), vbMinimizedNoFocus

 myWnd2 = FindWindow("ThunderRT6FormDC", "Form1")
End Sub
  '
  '


Viewing all articles
Browse latest Browse all 21690

Trending Articles



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