Sign in to follow this  
Followers 0
Total_newbie

Problem with WinActive

3 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by Manadar

Share this post


Link to post
Share on other sites

$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
That worked. I didn't know I had to wait for the window to become active.

Thanks

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0