Jump to content
Sign in to follow this  
bird42

my first script

Recommended Posts

bird42

hi to all,

this is my first script...

CODE

#include <Date.au3>

#include <GuiConstants.au3>

#include <Constants.au3>

#include<sound.au3>

#NoTrayIcon

FileInstall("C:\aero_busy.ani",@scriptdir&"\alarmico.ani")

$gui = GuiCreate("Alarm", 200,160, -1, -1)

$font="Arial"

GUISetFont(9, 400, 0, $font)

$timelabel = GuiCtrlCreatelabel("Time : " & _NowTime(), 20, 20, 150, 20)

$datelabel = GuiCtrlCreatelabel("Date : " & _NowDate(), 20, 40, 150, 20)

GUICtrlCreateGroup("Clock ", 10, 5, 160, 55)

GUICtrlCreateGroup("Alarm ", 10, 60, 180, 75)

$1=GUICtrlCreateInput("hour",20,75,40,20,$ES_NUMBER)

GuiCtrlCreatelabel(".", 67, 80,5, 20)

$2=GUICtrlCreateInput("min",75,75,40,20,$ES_NUMBER)

$3=GUICtrlCreateInput("message here",20,105,150,20)

GuiCtrlCreatelabel("Activate :", 20,140,60,20)

$c=GUICtrlCreateCheckbox("",80,140,20,20)

GUICtrlCreateIcon(@ScriptDir & "\alarmico.ani",-1,150,20,32,32)

GuiSetState(@SW_SHOW)

Opt("TrayOnEventMode",1)

Opt("TrayMenuMode",1)

Opt("GUIOnEventMode", 1)

GUISetOnEvent($GUI_EVENT_CLOSE, "ExitScript")

GUISetOnEvent($GUI_EVENT_MINIMIZE, "_MinTray")

$aboutitem = TrayCreateItem("About")

TrayItemSetOnEvent(-1,"aboutmsg")

$restoreitem = TrayCreateItem("Restore")

TrayItemSetOnEvent(-1,"RestoreTray")

TrayCreateItem("")

$exititem = TrayCreateItem("Exit")

TrayItemSetOnEvent(-1,"ExitScript")

TraySetState(2)

While 1

$m=GUIGetMsg()

$a=GUICtrlRead($1)

$b=GUICtrlRead($2)

$mex=GUICtrlRead($3)

sleep(1000)

GuiCtrlSetData($timelabel, "Time : " & _NowTime())

if GUICtrlRead($c)=1 Then

if $a =@HOUR And $b =@MIN Then

Beep(500,100)

SoundPlay("c:\track.wav")

MsgBox(0,"Alarm",$mex)

Exit

Else

EndIf

Else

EndIf

WEnd

Func aboutmsg()

MsgBox(0,"About","############")

EndFunc

Func _MinTray()

GuiSetState(@SW_HIDE)

TraySetState(1)

EndFunc

Func RestoreTray()

GuiSetState(@SW_SHOW)

GuiSetState(@SW_RESTORE)

TraySetState(2)

EndFunc

Func ExitScript()

Exit

EndFunc

Edited by zentral

Share this post


Link to post
Share on other sites
d4rk

Nice first step ...


[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites
gseller

Nice first script... :) Keep up the good work...

Share this post


Link to post
Share on other sites
bird42

Thanks !

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  

×