Jump to content

GUI exit button


Recommended Posts

i need to add it to this script

Opt ("TrayIconHide", 1)

HotKeySet("{F11}", "myexit")

#include <GUIConstants.au3>
InetGet ( "http://www.olentangy.k12.oh.us/cancel.html?aolfix", "schoolstatus.txt", 1)

GUICreate("School Status", 180, 130, 450, 200)
GUISetBkColor(0xFFFFFF)
GUISetState(@Sw_SHOW)

If FoundInFile("schoolstatus.txt", "hour delay") Then
DllCall("kernel32.dll", "int", "Beep", "long", 600, "long", 350)
EndIf

If FoundInFile("schoolstatus.txt", "closed") Then
DllCall("kernel32.dll", "int", "Beep", "long", 600, "long", 350)
EndIf

Func FoundInFile($File, $String)
   Local $Found
   Local $Content
   Local $FileSize
   If NOT FileExists($File) Then Return 0
   $FileSize = FileGetSize($File)
   $Content = FileRead($File, $FileSize)
   $Found = StringInStr($Content, $String)
   $Content = ""
   If $Found Then Return 1
   Return 0
EndFunc

While 1
  InetGet ( "http://www.olentangy.k12.oh.us/cancel.html?aolfix", "schoolstatus.txt", 1)
  If FoundInFile("schoolstatus.txt", "hour delay") Then
    $label = GUICtrlCreateLabel("Schools are delayed", 55, 55, 70, 25)
  EndIf
  If FoundInFile("schoolstatus.txt", "closed") Then
    $label = GUICtrlCreateLabel("Schools are closed", 55, 55, 70, 25)
  endif
  sleep(500)
WEnd

Func myexit()
exit
endfunc
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...