TinyDwarf Posted November 21, 2005 Share Posted November 21, 2005 Hello I would Like check if one windows is open or one other... The script can be like that but I know it's not right: If WinWaitActive("Windows_Title1", "Windows_Text1") Then MsgBox(0, "", "Windows2") ElseIf WinWaitActive("Windows_Title2", "Windows_Text2") Then MsgBox(0, "", "Windows2") EndIf Thk you for you help. Link to comment Share on other sites More sharing options...
Just_Plain_Cool Posted November 21, 2005 Share Posted November 21, 2005 Hello I would Like check if one windows is open or one other... The script can be like that but I know it's not right: If WinWaitActive("Windows_Title1", "Windows_Text1") Then MsgBox(0, "", "Windows2") ElseIf WinWaitActive("Windows_Title2", "Windows_Text2") Then MsgBox(0, "", "Windows2") EndIf Thk you for you help. Try the code below. I used WinActive() to match up with what you were attempting before. If you only want to know if it exists and it doesn't need to be active then use WinExists(). While 1 If WinActive("Windows_Title1", "Windows_Text1") Then;if your first window is open and active then pop up MsgBox and leave the loop MsgBox(0, "", "Windows1") ExitLoop ElseIf WinActive("Windows_Title2", "Windows_Text2") Then;if your second window is open and active then pop up MsgBox and leave the loop MsgBox(0, "", "Windows2") ExitLoop EndIf Sleep(10);keep this loop from being a system hog WEnd Hope this helps, JPC Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now