Total_newbie Posted March 26, 2007 Share Posted March 26, 2007 Hi all, I'm trying to do the basic of testing if a Windows is active. The windows title would looks like "HexEdit - C:\filename.pst" but even activating the windows I still get the same error of Window not Active. Anybody could help me? Thanks CODE $message = "Please select PST file that you want to recover." $var = FileOpenDialog($message, "C:" & "\", "PST files (*.pst)", 1 + 4 ) Run("hexedit.exe " & $var) If WinActive("HexEdit - "& $var) Then MsgBox(0,"Windows","Active") ;ConsoleWrite ("OK" & @CRLF) Else MsgBox(0,"Windows","not active") ;ConsoleWrite("Windows is not active") EndIf Link to comment Share on other sites More sharing options...
jvanegmond Posted March 26, 2007 Share Posted March 26, 2007 (edited) $message = "Please select PST file that you want to recover." $var = FileOpenDialog($message, "C:" & "\", "PST files (*.pst)", 1 + 4 ) Run("hexedit.exe " & $var) WinWait("HexEdit - "& $var) ; wait for the window to exist! If WinActive("HexEdit - "& $var) Then MsgBox(0,"Windows","Active") ;ConsoleWrite ("OK" & @CRLF) Else MsgBox(0,"Windows","not active") ;ConsoleWrite("Windows is not active") EndIf Edited March 26, 2007 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
Total_newbie Posted March 26, 2007 Author Share Posted March 26, 2007 $message = "Please select PST file that you want to recover." $var = FileOpenDialog($message, "C:" & "\", "PST files (*.pst)", 1 + 4 ) Run("hexedit.exe " & $var) WinWait("HexEdit - "& $var) ; wait for the window to exist! If WinActive("HexEdit - "& $var) Then MsgBox(0,"Windows","Active") ;ConsoleWrite ("OK" & @CRLF) Else MsgBox(0,"Windows","not active") ;ConsoleWrite("Windows is not active") EndIfThat worked. I didn't know I had to wait for the window to become active. Thanks 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