3xnano
Home page News > General News > Advanced Query Commands Permanent link to this page

Syndicate


Valid XHTML 1.0 Transitional

Follow us on Twitter

Follow kkourentzes on Twitter

GoogleBox

GoogleChat


Newsflash

A small Alarm Application
Written by Administrator
Tuesday, 06 September 2011

At some point today i needed a very basic alarm program ... to play an mp3 file at a predefined time ! So I decided to write one just for the fun of it (in autoit which I am very fond of when it comes to really small apps / tools).

It has absoluely no features. It's a very basic application and if it weren't for the embedded mp3 file and the colourful icon I used it would have been less than 100kb.

You can download the X86 version here or the X64 version here.

Both are the final compiled exe files. (chrome might give you trouble when trying to download)

The source for those who want to use it is as follows...

 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\..\Downloads\alarmd.ico
#AutoIt3Wrapper_Outfile=AlarmX86.exe
#AutoIt3Wrapper_Outfile_x64=AlarmX64.exe
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_Res_Comment=A simple Alarm program
#AutoIt3Wrapper_Res_Description=A simple Alarm program
#AutoIt3Wrapper_Res_Fileversion=1
#AutoIt3Wrapper_Res_LegalCopyright=Konstantinos Kourentzes 2011
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;alarm !


Global $curyear,$curmonth,$curday,$curhour,$curmin
Global $year,$month, $day, $hour, $minute, $playfile



FileInstall("Wake_Up_Funny.mp3",@TempDir&"\WakeUpFunny.mp3",1)

$checkforfile = FileExists(@UserProfileDir&"\ktimer.cfg")

if $checkforfile == 1 Then

$file = FileOpen(@UserProfileDir&"\ktimer.cfg")
$year = FileReadLine($file,1)
$month = FileReadLine($file,2)
$day = FileReadLine($file,3)
$hour = FileReadLine($file,4)
$minute = FileReadLine($file,5)
$playfile = FileReadLine($file,6)

FileClose($file)

Else

    Set_Alarm_Time()



EndIf

;Disregard default Tray
Opt("TrayMenuMode",1)

;Create my tray menu

$resetitem        = TrayCreateItem("Set Alarm")
$aboutitem      = TrayCreateItem("About")
TrayCreateItem("")
$autostartitem    = TrayCreateItem("Create a link on startup folder")
TrayCreateItem("")


$exititem       = TrayCreateItem("Exit")

TraySetState()


while 1=1
    Get_Cur_Time()    ;check for alarm conditions status
    $msg = TrayGetMsg() ; check tray menu
    Select
        Case $msg = 0
            ContinueLoop
        Case $msg = $aboutitem
            Msgbox(64,"About:","Just for fun!!!"&@CRLF&"Konstantinos Kourentzes 2011",120)
        Case $msg = $exititem
            ExitLoop
        Case $msg = $resetitem
            Set_Alarm_Time()
        Case $msg = $autostartitem
            FileCreateShortcut(@ScriptFullPath,@StartupDir&"\Alarm.lnk")
    EndSelect

WEnd

Func Get_Cur_Time()
    $curyear = @YEAR
    $curmonth = @MON
    $curday = @MDAY
    $curhour = @HOUR
    $curmin = @MIN

    if $curyear >= $year Then
        if $curmonth >= $month Then
            if $curday >= $day Then



                if $curhour == $hour Then
                    if $curmin >= $minute Then
                        Wake_UP()
                    EndIf
                ElseIf $curhour > $hour Then
                    Wake_UP()
                EndIf



            EndIf

        EndIf

    EndIf



EndFunc


Func Set_Alarm_Time()
    $year = 0
    While (($year < @YEAR) Or ($year>3000))
        $year = InputBox("Year","Year of Alert (enter 4 digits ex.:2012)",@YEAR)
    WEnd
    $month = 0
    While (($month <1) or ($month>12))
        $month = InputBox("Month","Month of Alert(enter 2 digits, Valid Values are 01-12)",@MON)
    WEnd
    $day = 0
    while (($day<1) or ($day>30) or ((($month = 1) or ($month = 3) or ($month = 5) or ($month = 7) or ($month = 9) or ($month = 11)) and ($day>31)) )
        $day = InputBox("Day","Day of Alert (enter 2 digits, Valid is 01-31)",@MDAY)
    WEnd
    $hour = 24
    while (($hour<0) or ($hour>23))
        $hour = InputBox("Hour","Hour of Alert (enter 2 digits, Valid is 00 - 23)","00")
    WEnd
    $minute = 60
    while (($minute<0) or ($minute>59))
        $minute = InputBox("Minute","Minutes of Alert (enter 2 digit, Valid is 00 - 59)","00")
    WEnd
    $playfile = FileOpenDialog("Select MP3 to play",@TempDir,"MP3 files(*.mp3)",1,"WakeUpFunny.mp3")
    If @error Then
        $playfile = @TempDir&"\WakeUpFunny.mp3"
    EndIf

    $file = FileOpen(@UserProfileDir&"\ktimer.cfg",2)
    FileWriteLine($file,$year)
    FileWriteLine($file,$month)
    FileWriteLine($file,$day)
    FileWriteLine($file,$hour)
    FileWriteLine($file,$minute)
    FileWriteLine($file,$playfile)
    FileClose($file)

    MsgBox(0,"Alarm Set","On the "&$day&"/"&$month&"/"&$year&@CRLF&@CRLF&"and at "&$hour&":"&$minute&@CRLF&@CRLF&@CRLF&"alarm will play "&$playfile)

    EndFunc


    Func Wake_UP()
        SoundPlay($playfile,0)
        $q = MsgBox(20,"The time has come.","Reset Alarm (Yes) or close Alarm (No)",600)
        if $q == 6 Then
            Set_Alarm_Time()
        ElseIf $q == 7 Then
            Exit 1
        Else
            SoundPlay($playfile,1)
            Set_Alarm_Time()
        EndIf

    EndFunc

 

Last updated ( Tuesday, 06 September 2011 )
 

Latest News

Advanced Query Commands
Export to PDF Permanent link to Advanced Query Commands Email Print
Written by Administrator
Sunday, 04 April 2010
Advanced Query Syntax

The Advanced Query Syntax (AQS) is used by Microsoft Windows Desktop Search (WDS) to help users and programmers better define and narrow their searches. Using AQS is an easy way to narrow searches and deliver better result sets. Searches can be narrowed by the following parameters:

  • File kinds: folders, documents, presentations, pictures and so on.
  • File stores: specific databases and locations.
  • File properties: size, date, title and so on.
  • File contents: keywords like "project deliverables," "AQS," "blue suede shoes," and so on.

Furthermore, search parameters can be combined using search operators. The remainder of this section explains the query syntax, the parameters and operators, and how they can be combined to offer targeted search results. The tables describe the syntax to use with WDS, as well as the properties that can be queried for each file kind displayed in the Windows Desktop Search results window.

Desktop Search Syntax

A search query can include one or more keywords, with Boolean operators and optional criteria. These optional criteria can narrow a search based on the following:

  • Scope or data store in which files reside
  • Kinds of files
  • Managed properties of files

The optional criteria, described in greater detail following, use the following syntax:

<scope name>:<value>

<file kind>:<value>

<property name>:<value>

Suppose a user wants to search for a document containing the phase "last quarter," created by John or Joanne, and that the user saved to the folder mydocuments. The query may look like this:

"last quarter" author:(john OR joanne) foldername:mydocuments

 

Read the original article from MSDN here

Last updated ( Sunday, 04 April 2010 )

Read more...

1952 Views, 0 Comments
 
Windows 7 Start Button Changer
Export to PDF Permanent link to Windows 7 Start Button Changer Email Print
Written by Administrator
Thursday, 25 March 2010

A small application to change the win button for Windows 7

You can get it here,

http://www.softpedia.com/get/Tweak/System-Tweak/Windows-7-Start-Button-Changer.shtml

 

 

Last updated ( Thursday, 25 March 2010 )

Read more...

7673 Views, 1 Comment
 
Windows 7 Logon Background Changer
Export to PDF Permanent link to Windows 7 Logon Background Changer Email Print
Written by Administrator
Thursday, 25 March 2010

 

 

Get it here,

www.julien-manici.com/windows_7_logon_background_changer/

 

windows 7 Logon Background Changer

Last updated ( Thursday, 25 March 2010 )

Read more...

7648 Views, 0 Comments
 
SpiceWorks
Export to PDF Permanent link to SpiceWorks Email Print
Written by God
Sunday, 07 March 2010
 
Free Networking Monitoring Software For Network Management
 
 
Last updated ( Sunday, 07 March 2010 )

1628 Views, 0 Comments
 
Thunderbird to Outlook
Export to PDF Permanent link to Thunderbird to Outlook Email Print
Written by Administrator
Sunday, 21 February 2010

Best way to export from thunderbird to Outlook is:

Navigate to your Thunderbird profile folder, usually found in C:\Documents and Settings \ [User Name] \ Application Data \ Thunderbird \ Profiles \. Here Thunderbird stores your Inbox, Sent mail, etc as two files – one with, one without .msf extensions.

Convert these files to .eml files by downloading IMAPSize (from here http://www.broobles.com/imapsize/index.php). Go to Tools > mbox2eml. Select the file without the extension. Choose a storage location for generated eml files and click ‘Convert’.

In Outlook Express select the local folder, such as Inbox, to which you want to import messages. Open Windows Explorer, locate the folder where you stored the new .eml files, and simply drag and drop them into the Outlook Express window.

Outlook can mass import them from the import tools

be warned it will take a while as it does it message by message.


And to convert the address book use this utility: http://www.joshie.com/projects/dawn/download.html .

Last updated ( Sunday, 21 February 2010 )

1717 Views, 0 Comments
 
Direct 3D effects from command line (Vista+)
Export to PDF Permanent link to Direct 3D effects from command line (Vista+) Email Print
Written by Administrator
Wednesday, 06 January 2010

There is a tool in windows Vista that benchmarks the direct 3d of your system

Paste  the following on a command line

winsat aurora -time 15

or sth more interesting ?

winsat d3d -totalobj 22 -objs C(22) -totaltex 11 -texpobj C(11) -alushader -v -time 15

 

Last updated ( Wednesday, 06 January 2010 )

Read more...

2403 Views, 0 Comments
 
Softone Inner Page
Export to PDF Permanent link to Softone Inner Page Email Print
Written by Administrator
Sunday, 03 January 2010

Always there was need for better connectivity among the users of ERP systems

Now this is possible with the new features of the http://kourentzes.com/softone/ site intented for use with softone ERP

Last updated ( Sunday, 03 January 2010 )

Read more...

7179 Views, 0 Comments
 
Evony Farmer
Export to PDF Permanent link to Evony Farmer Email Print
Written by Administrator
Sunday, 30 August 2009

New farmer links available for Download

Farmer manual

Farmer Installer

Last updated ( Sunday, 30 August 2009 )

2815 Views, 0 Comments
 
Wallpaper Pack III
Export to PDF Permanent link to Wallpaper Pack III Email Print
Written by Administrator
Monday, 27 July 2009

New Quality Wallpaper Pack

44 MB of HD Wallpapers

You can download the wallpapers from here.

Last updated ( Monday, 27 July 2009 )

1539 Views, 0 Comments
 
CIO / CTO ?
Export to PDF Permanent link to CIO / CTO ? Email Print
Written by Administrator
Tuesday, 19 May 2009

One of the questions I hear with some frequency is “what’s the difference between a CIO and a CTO?”

Both have to do with technology and products and management, CTO goes for external matters and CIO for internal


Last updated ( Tuesday, 19 May 2009 )

Read more...

3553 Views, 2 Comments
 
<< Start < Prev 1 2 3 4 5 6 7 8 Next > End >>

Polls

Most annoying Windows 10 feature
  

GoogleAds

Event Calendar

<< Prev Jul 2017 Next >>
Mon Tue Wed Thu Fri Sat Sun
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

SpiceWorks

Free Networking Monitoring Software For Network Management