How do I know from one application that another application has an active form.
Same machine (windows) running two application (a.exe and b.exe) both created in vb.net. How can a.exe know that b.exe form2 is open or not?
I know that b.exe is running via:
Public Function IsApplicationRunning(ByVal appName As String) As Process
For Each aProcess in Process.GetProcesses()
If aProcess.ProcessName.StartsWith(appName, StringComparisong.CurrentCultureIgnoreCase) Then
There is no direct way and Form2 needs to expose something that can be used to identify it (e.g. a certain title).
You already have the process handle. Then, check every window of that process. If you find a window that matches, it is very likely that the specified form is open. However, there is no guarantee because it could always be a window that looks similar (but that is based on another class).
Asked in February 2016Viewed 3,092 timesVoted 10Answered 1 times