Jump to content

how to properly close pg2


Recommended Posts

im trying to write a script to close peer guardian 2 with out involving the mouse. i am able to end the process, but it has 'side effects'. when i end the process rather than 'properly exiting' the program, it gives an error msg(see pic). ideally i would rather find a way to 'properly exit' than having to deal with the PG2 Fix utility that is needed to fix the error msg. i tried modifying the code from this post: http://www.autoitscript.com/forum/index.php?showtopic=86316 but not having much luck. any help is greatly appreciated! -Joe

post-45156-1232985104_thumb.gif

Link to comment
Share on other sites

Try the following if PG2 is already running in the systray( if not start it first ;-) ), it'll uncheck the 'Hide window on close' checkbox , then close it correctly next it'll restart PG2 and reset the check box back to normal

(works if PG2 has been installed into it's default install directory)

CODE

ControlCommand("PeerGuardian 2", "", 1172, "UnCheck", "")

WinClose("PeerGuardian 2", "")

Sleep(1000)

Run(@ProgramFilesDir&"\PeerGuardian2\pg2.exe")

WinWaitActive("PeerGuardian 2","")

ControlCommand("PeerGuardian 2", "", 1172, "Check", "")

WinClose("PeerGuardian 2", "")

Edited by Thamiel
Link to comment
Share on other sites

Try the following if PG2 is already running in the systray( if not start it first ;-) ), it'll uncheck the 'Hide window on close' checkbox , then close it correctly next it'll restart PG2 and reset the check box back to normal

(works if PG2 has been installed into it's default install directory)

CODE

ControlCommand("PeerGuardian 2", "", 1172, "UnCheck", "")

WinClose("PeerGuardian 2", "")

Sleep(1000)

Run(@ProgramFilesDir&"\PeerGuardian2\pg2.exe")

WinWaitActive("PeerGuardian 2","")

ControlCommand("PeerGuardian 2", "", 1172, "Check", "")

WinClose("PeerGuardian 2", "")

SWEET! Thanx Thamiel! Ur code works flawlessy and its short n sweet.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...