Jump to content
Sign in to follow this  
poo706

Diferentiate between regular window and background task

Recommended Posts

poo706

I've noticed with versions of Word and Excel (verified with 2000 and 2003) that sometimes after you shut down Word or Excel, it will continue running in the background. Sometimes with Word especially, it'll consume 100% of the CPU and drag the system to a halt. Hitting Ctrl-Alt-Del and ending the process fixes the problem.

So I was trying to write a script that would run Word and wait until it's been closed by the user. Then I want it check to make sure there are no Word windows open (in case I have multiple .doc's open), and end the script if any Word window is open. If no Word window is open, I want it to check and see if there are any winword.exe processes running in the background, and then end the process if true. Problem is, I can't seem to get AutoIt3 to be able to tell the difference between an open window and a running process. I have experimented with WinGetState, WinActive, WinExists, and a few others, but they all seem to recognize the background process as an open window.

Anyone have any experience with situations like this?

[poo]

Share this post


Link to post
Share on other sites
poo706

That's a bit fancier than the things I was trying, but more or less the same, just split up in different steps. I will give that a try. Problem is, to truly test this out I need Word or Excel to screw up and stay running, which doesn't happen all the time, and I can't seem to figure out what causes it to begin with. I saw it happen on a friend's computer too, so it's not just mine. Thanks for the help!

[poo]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.