Jump to content
Sign in to follow this  
DougfromCCI

WinWaitClose VS ProcessWaitClose

Recommended Posts

DougfromCCI

Hello all, I'm new to this, so I'm not sure if this scripting will do what I want it to. I'm looking to have a script running from startup folder that reminds the user to wait until outlook is syncronized with our server, after closing outlook, and before they shutdown or network dissconnect. This will just go on problem users so their PST files are not continually corrupted.

I can't find a way to get a pop up window to come up when they close outlook. The process is still running (sometimes for many minutes) until the sync is done. I've tried WinWaitClose and ProcessWaitClose and they both trigger after the outlook.exe process is gone, not after the window is closed.

AutoItSetOption("WinTitleMatchMode", 2)

;Something here to do what I want it to

ProcessWaitClose ("Outlook.exe")

MsgBox(0, "PC Dept", "Outlook is now closed." & @CRLF & "It is now safe to Restart, Shutdown, or Disconnect from the network.")

Thanks for your help

Share this post


Link to post
Share on other sites
Valuater

Based on your explanation, Maybe you could try...

If WinExits() ???

or

While WinExists()

Sleep(1000)

Wnd

??

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Jos

I can only assume that the Outlook window hides during the closedown of the program.

Do you want the Msgbox() to popup even while outlook isn't done with the closing process yet?

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
blakel

This is something to try...no guarantees

check if WinGetState is visible

If it is just hiding before process close

it might be interesting to

WinSetState @SW_SHOW and @SW_ENABLE

and see what it is doing.

Share this post


Link to post
Share on other sites
DougfromCCI

@Valuater - tried a similar while loop, it accomplishes the same thing as my code.

@Jos - I think your right, I think a 'File --> Exit' actually minimizes to a tray icon while syncing and closing out OST and PST files, and then disappears out of the tray when the process completes. I want the pop up to show up after the user "exits" while is in this minimized to tray, about to close state. Warning the user to wait for the second popup saying it closed successfully, which my above code already does.

@blakel - I'll give that a try

Share this post


Link to post
Share on other sites
JackDinn

i would have a look to see if there is another process/service that is doing the sync, find it's name and work with that as well as outlook.exe

duno if there is another process/service doing the sync as i dont have outlook (killed it ^_^) but if there is then you can just say if ProcessExists ("sync.exe") etc..

but peeps above are prob right the outlook window must just be hidden

Edited by JackDinn

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

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  

×