For some applications for example Iexplorer each open window is representative of one process so you can simply check for their existence as follows:But the problem is when the application has some child windows and you are looking to see if the child window is open or not. By the above example you will get the main window title. So you may use this code:VB Code:
Dim pr As Process For Each pr In Process.GetProcesses If pr.MainWindowTitle = "somthing" Then MessageBox.Show("That window exists") End If Next
VB Code:
Dim pr As Process For Each pr In Process.GetProcesses If pr.MainWindowTitle = "Somthing" Then Dim winds As New Win32Util.Win32Window(pr.MainWindowHandle) Dim child As Win32Util.Win32Window For Each child In winds.GetThreadWindows(winds.ThreadId) MessageBox.Show(child.Text) Next End If Next




Reply With Quote