Jump to content

Sit in system tray and wait ?


Recommended Posts

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 .

Link to comment
Share on other sites

;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
Link to comment
Share on other sites

  • Developers

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

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

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

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...