Sign in to follow this  
Followers 0
bobheart

Sit in system tray and wait ?

6 posts in this topic

I want to have the program(autoit) sit in the system tray and wait if an exe opens then close it right away . but I can't get it to stay in the system tray it just closes .

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

;Generated with AutoBuilder 0.3

Opt("GUICoordMode", 1)

Opt("GUINotifyMode", 1)

GuiCreate("MyGUI", 392,272,10,10,0x04CF0000)

$label_1 = GUISetControl("label", "Leave running to stop program", 30,40, 170,30)

GuiShow()

While 1

sleep(100)

$msg = GuiMsg(0)

Select

Case $msg = -3

Exit

Case $msg = $label_1

ProcessClose("iexplore.exe")

;;;

EndSelect

WEnd

Exit

~~~~~~~~~~~

That was the 2 one i tried this was the 1 one I tried

ProcessClose("C:\Program Files\Internet Explorer\iexplore.exe")

Edited by bobheart

Share this post


Link to post
Share on other sites

If you want it to sit "forever" in the systemtray just killing ieexplorer then this should work:

While 1
   If ProcessExists("iexplore.exe") then ProcessClose("iexplore.exe")
Wend

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thanks ..

Share this post


Link to post
Share on other sites

If you want it to sit "forever" in the systemtray just killing ieexplorer then this should work:

While 1
   If ProcessExists("iexplore.exe") then ProcessClose("iexplore.exe")
Wend
if you add

ProcessWait ( "process" [, timeout] )

to that in the loop it will cut cpu usage. I wouldn't even use the timeout

Rick


Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm

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  
Followers 0