Sign in to follow this  
Followers 0
Robonglious

WinWait issues

5 posts in this topic

Hello again,

I'm having some issues with WinWait. What I want to do is make some kind of benchmark where I can time how long programs take to open.

It works great with Word(2010) but not with Excel(2010). I've tried this little bit of code to look up the handle using the PID but that doesn't seem to work and I'm wondering if anyone can help me understand how to look this up.

Thank you, I'm feeling like I've got a long ways to go but I'm psyched.

I'm slightly embarrassed about this bit of code...

Local $begin = TimerInit()
Run("C:\Program Files (x86)\Microsoft Office\Office14\winword.exe")
WinWait("Document1 [Compatibility Mode] - Microsoft Word")
$WordCount = Round ( (TimerDiff($begin)/1000) , 2 )
Run("C:\Program Files (x86)\Microsoft Office\Office14\Powerpnt.exe")
WinWait("Presentation1 [Compatibility Mode} - Microsoft PowerPoint")
$PowerCount = Round ( (TimerDiff($begin)/1000) , 2 )
MsgBox(64,"IS Department Benchmark for Word","Please see the opening time of word." & @CR & $WordCount &"Seconds" & $PowerCount & " seconds")

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Not sure if this works more like you wish or not...

Local $begin = TimerInit()
$oWord = ObjCreate("Word.Application")
ProcessWait("winword.exe")
$WordCount = Round ( (TimerDiff($begin)/1000) , 2 )
$oWord.quit

$begin = TimerInit()
$oExcel = ObjCreate("Excel.Application")
ProcessWait("Excel.exe")
$ExcelCount = Round ( (TimerDiff($begin)/1000) , 2 )
$oExcel.quit

$begin = TimerInit()
$oPP = ObjCreate("Powerpoint.Application")
ProcessWait("Powerpnt.exe")
$PPCount = Round ( (TimerDiff($begin)/1000) , 2 )
$oPP.quit

MsgBox(64,"IS Department Benchmarks","Word: " & $WordCount & " seconds" & @CRLF & _
         "Excel: " & $ExcelCount & " seconds" & @CRLF & _
         "Powerpoint: " & $PPCount & " seconds")

Edit: This would only time how long it takes to load and start the program (process), not how long it takes to fully initialize the program, process any parameters, and display a finished window. Maybe there is something in there you'll find inspiring.

Edited by Spiff59

Share this post


Link to post
Share on other sites

Yes that is very inspiring, but I'm confused. How did you know that "Word.Application" is correct? Is there a list of these objects somewhere?

This works much better thank you.

Share this post


Link to post
Share on other sites

Killer... thanks Spiff.

I have so much to learn!

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