Jump to content

Recommended Posts

Posted

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

Posted

is there a 'right click' command in autoit? if so, the icon may be in different locations in the tray at any given time. i appreciate your quick replies, thank you. im leaving for work now

Posted (edited)

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
Posted

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.

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
×
×
  • Create New...