Jump to content
Sign in to follow this  
lokeycmos

how to properly close pg2

Recommended Posts

lokeycmos

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

Share this post


Link to post
Share on other sites
lokeycmos

the problem with that is that when closed, it minimizes to the tray.

Share this post


Link to post
Share on other sites
lokeycmos

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

Share this post


Link to post
Share on other sites
Zedna

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

Search forum for some clever keywords maybe something like: +tray +popup

Share this post


Link to post
Share on other sites
Inverted

I wonder if two consecutive WinClose would do the job. Worth a quick try.

Share this post


Link to post
Share on other sites
Thamiel

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

Share this post


Link to post
Share on other sites
lokeycmos

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.

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  

×