Total_newbie Posted March 26, 2007 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
jvanegmond Posted March 26, 2007 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
Total_newbie Posted March 26, 2007 Author 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
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