Hi Chip: I have just read your other post. I didn't see that constant but I 
will check it out. As for WScript I was sort of guessing that is what the WE 
Objects were doing. The filter with a find to get the necessary info to perhaps 
set focus might work but what a messy work-around. I will try the constant you 
suggested before I start doing anything that radical to set focus. I was even 
thinking of trying to use a window message sent to the MsgBox window, but then 
there was a note that it would not work if the calling thread was diferent and 
I am guessing that my script is on a diferent thread than the WordPad app I am 
trying to script but I don't know for sure.I have the OnChildActivate and 
OnChildDeactivate working to handle a menu opening and closing due to selecting 
the Open item under the File Menu in WordPad. 
I needed something like that to Reset the ActiveWindow if another file is 
loaded into the WordPad editor before checking for duplicates. 
  That was the only thing I could think of to determine when the Open Dialog 
was opened and closed.I'll check out that VBScript constant tomorrow - really 
fried tonight. 
  Thanks for the help.
  Rick USA
  ----- Original Message ----- 
  From: Chip Orange 
  To: [email protected] 
  Sent: Thursday, April 28, 2011 5:59 PM
  Subject: RE: Can We Use WScript in WindowEyes VBScript App?


  Yes, I think so Rick.  wScript was designed to be used in the windows 
scripting host, and GW has tried to replace all of it's functionality by giving 
us their script object.  

  If the additional message box constant I gave in another email does not help 
this situation, then you could find your message box's windows using the 
various "filter" methods of the "windows" object, and then activate it using 
the window activate method of the window you found.

  hth,

  Chip




------------------------------------------------------------------------------
  From: RicksPlace [mailto:[email protected]] 
  Sent: Thursday, April 28, 2011 5:49 PM
  To: [email protected]
  Subject: Can We Use WScript in WindowEyes VBScript App?


  Hi Guys: 
  I was getting a MsgBox not getting focus and, i think, not on top of my 
target program's main window. 
  I used the following statements and they worked except...
  When I click OK I get an error message saying WScript Variable is not defined.
  Is there a problem using the root object, WScript with a WE App in VBScript?
  Here is the code that works but throws an error:
  BeginCopiedCode:
  WScriptCreateObject("WScript.Shell")
  Sleep 100
  WshShell.AppActivate "MyMessageBox"
  EndCopiedCode:
  Again, the MsgBox is now getting focus and is on top as I want but I get the 
error message after I click the OK Button. Do you know of any WE scripts that 
use WScript I might 
  look at?
  Rick USA

Reply via email to