Sign in to follow this  
Followers 0
Rahul Rohela

PSEXEC GUI

8 posts in this topic

#1 ·  Posted (edited)

Hi,

This is my First script to execute PSEXEC.exe tool form Sysinternals through GUI interface. Hope you all find it useful.

rahul

NOTE:- File Attached in next reply..

Edited by Rahul Rohela

Share this post


Link to post
Share on other sites



Rahul,

Could you please post the AutoIt code?

Thanks in advance

Arno Rog

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Rahul,

Could you please post the AutoIt code?

Thanks in advance

Arno Rog

Here is the source....

Updates & Suggestions are Welcome..

#include <GUIConstants.au3>
#Include <date.au3>
#include <Constants.au3>
Opt("TrayIconHide", 1)
Opt('TrayAutoPause', 0)
Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1)
TraySetState()
TrayCreateItem("")
$exititem   = TrayCreateItem("Exit")
TrayItemSetOnEvent(-1,"ExitScript")
TraySetClick (8)
TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE,"Show")


$mainwindow = GUICreate( "Psexec GUI" , 860 , 365 , $WS_EX_ACCEPTFILES )  ; will create a dialog box that when displayed is centered
Dim $WshShell, $FileSystem, $CommandLine, $SysAccount, $AccProfile, $IntractDesk, $CopyFileTo, $RunCom
Dim $Pram1, $mainwindow, $DisplayHelp, $ProcessOptions, $PCName1, $UserName1, $UPwd1, $SysAccount1
Dim $AccProfile1, $IntractDesk1, $CopyFileTo1, $ForceCopy1, $CopyIF1, $TermiNate1, $AppFile1, $PPriority1, $ProcessorInf1
Dim $ForceCopy, $PPriority, $PriorityValue, $PCName, $PCid, $UserName, $UserID, $UPwd, $PassWd, $CopyIF
Dim $TermiNate, $AppFile, $FileIn, $Processor, $msg, $Chb_State, $State1, $State2, $State3, $State4, $State5
Dim $State6, $State7, $State8, $State9, $State10, $State11, $State12
Global $sec = @SEC, $minute, $hour, $light, $time, $clocklabel

$PCName = GUICtrlCreateCheckbox ("Type IP or PC Name e.g.\\PCname or \\PC's IP", 10, 10, 400, 20, $WS_TABSTOP)
$PCid = GUICtrlCreateInput ( "\\", 450,  10, 400, 20, $WS_TABSTOP )
GUICtrlSetTip($PCid,"Network PC name or IP starting with \\")

$UserName = GUICtrlCreateCheckbox ("Type User Name Domain\Username (-u)", 10, 33, 400, 20, $WS_TABSTOP)
$UserID = GUICtrlCreateInput ( "", 450,  33, 400, 20, $WS_TABSTOP )
GUICtrlSetTip($UserID,"LoginID")

$UPwd = GUICtrlCreateCheckbox ("Specifies optional password for user name.(-p)", 10, 56, 400, 20 )
$password = GUICtrlCreateInput ( "", 450,  56, 400, 20, $ES_PASSWORD )
GUICtrlSetTip($password,"Password of mentioned login. Else it will ask later")

$SysAccount = GUICtrlCreateCheckbox ("Run the remote process in the System account (-s)", 10, 79, 400, 20, $WS_TABSTOP)
$AccProfile = GUICtrlCreateCheckbox ("Loads the specified account's profile (-e)", 10, 102, 400, 20, $WS_TABSTOP)
$IntractDesk = GUICtrlCreateCheckbox ("interacts with the desktop (-i)", 10, 125, 400, 20, $WS_TABSTOP)
$CopyFileTo = GUICtrlCreateCheckbox ("Copy the specified program to the remote system (-c)", 10, 148, 400, 20, $WS_TABSTOP)
$ForceCopy = GUICtrlCreateCheckbox ("Copy the specified program even if the file already exists (-f)", 10, 171, 400, 20, $WS_TABSTOP)
$CopyIF = GUICtrlCreateCheckbox ("Copy the specified file only if it has a higher version number (-v)", 10, 194, 400, 20, $WS_TABSTOP)
$TermiNate = GUICtrlCreateCheckbox ("Don't wait for process to terminate (non-interactive) (-d)", 10, 217, 400, 20, $WS_TABSTOP)
$AppFile = GUICtrlCreateCheckbox ("Name of application to execute and Arguments", 10, 240, 400, 20, $WS_TABSTOP)
$FileIn = GUICtrlCreateInput ( "", 450,  240, 400, 20, $WS_TABSTOP )
GUICtrlSetTip($FileIn,"Command or EXE to execute. Must be in Path or provide Absolute path")
$PPriority = GUICtrlCreateCheckbox ( "Specifies -low, -belownormal, -abovenormal, -high or -realtime (-priority)", 10, 263, 400, 20, $WS_TABSTOP)
$PriorityValue = GUICtrlCreateCombo ( " -low", 450,  263, 100,200,$CBS_DROPDOWN, $WS_EX_OVERLAPPEDWINDOW )
GUICtrlSetData(-1," -belownormal| -abovenormal| -high| -realtime","")
GUICtrlSetTip($PriorityValue,"Set Priority ")
$ProcessorInf = GUICtrlCreateCheckbox ( "Separate processors on which the application can run with commas(-a)", 10, 286, 400, 20, $WS_TABSTOP)
$Processor = GUICtrlCreateInput ( "", 450,  286, 400, 20, $WS_TABSTOP )
GUICtrlSetTip($Processor,"Processor(s) to Use")
$DisplayHelp = GUICtrlCreateButton ("&Help",  450, 315, 50, 25, $WS_TABSTOP)
GUICtrlSetTip($DisplayHelp,"Psexec Command help, Click and know Switches")
$ProcessOptions = GUICtrlCreateButton ("&OK",  590, 315, 50, 25, $WS_TABSTOP)
GUICtrlSetTip($ProcessOptions,"Execute seletion")
$Closedown = GUICtrlCreateButton ( "&Close", 520, 315, 50, 25, $WS_TABSTOP )
GUICtrlSetTip($Closedown,"Close Window")


        Func CmdRun()
        ;****************main command
        StringIsSpace($Pram1)
        $Pram1 = $PCName1 &  $UserName1 &  $UPwd1 &  $SysAccount1 &  $AccProfile1 &  $IntractDesk1 &  $CopyFileTo1 &  $ForceCopy1 &  $CopyIF1 &  $TermiNate1 &  $AppFile1 &  $PPriority1 &  $ProcessorInf1
        $CommandLine = "psexec " & $Pram1
        $RunCom = MsgBox (1, "This is the psexec command that you just configured:", "Do you want to execute it " & Chr(13) & Chr(13) & $CommandLine & Chr(10) & Chr(10))
        If $RunCom = 1 Then
        RunWait ( "cmd /t:9f /k" & $CommandLine )
        Else 
        GUICtrlSetState ( $PCName, $GUI_FOCUS )
        EndIf
        EndFunc
;msgbox( 0, "output  ", GUICtrlRead ($SysAccount))
;msgbox(0,"test", $CommandLine)



;****************Clock*****************
opt("WinWaitDelay", 100)
opt("WinTitleMatchMode", 4)
opt("WinDetectHiddenText", 1)
opt("MouseCoordMode", 0)
;GUICreate("Max's Clock", 200, 50, (@DesktopWidth - 188) / 2, (@DesktopHeight - 59) / 2)
$clocklabel = GUICtrlCreateLabel(" Loading...", 700, 320, 82, 19, 0x1000)
GUICtrlSetTip($clocklabel, _nowDate())
GUICtrlSetFont($clocklabel, 10)
;***************************************




GUISetState (@SW_SHOW)
While 1
    $msg1 = TrayGetMsg()
    $msg = GUIGetMsg()
    ;GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")
    Select
        ;If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    Case $msg = $GUI_EVENT_ClOSE
    Exit
    Case $msg = $Closedown
    Exit
    Case $msg = $DisplayHelp
    RunWait ( "cmd /t:9f /k Psexec /?" ) ;***********Command execute*******
    Case $msg = $ProcessOptions
    Call("CmdRun")
    Case $msg = $GUI_EVENT_MINIMIZE
    Call("SpecialEvents")
        ;Case $msg1 = $exititem
;msgbox(0,"exit","sdljhashdljkh")
            ;ExitLoop
    EndSelect
;*****************************************
    

    $Chb_State = GUICtrlRead ($PCName)
    If $chb_state = $GUI_UNCHECKED Then
        $PCName1 = ""

    ElseIf $chb_state = $GUI_CHECKED Then
        $PCName1 = GUICtrlRead ($PCid)

    Else                    ; (=$GUI_INDETERMINATE)
        GUICtrlSetData($label,"n/a")
    EndIf
;********************************************** 
    $State1 = GUICtrlRead ($UserName)
    If $State1 = $GUI_CHECKED Then
        $UserName1 = " -u " & GUICtrlRead ($UserID)
    Else
        $UserName1 = ""
    EndIf
;**************************************
    $State2 = GUICtrlRead ($UPwd)
    If $State2 = $GUI_CHECKED Then
        $UPwd1 = " -p " & GUICtrlRead ($password)
    Else
        $UPwd1 = ""
    EndIf
;****************************************

    $State3 = GUICtrlRead ($SysAccount)
    If $State3 = $GUI_CHECKED Then
        $SysAccount1 = " -s "
    Else
        $SysAccount1 = ""
    EndIf
;****************************************
    $State4 = GUICtrlRead ($AccProfile)
    If $State4 = $GUI_CHECKED Then
        $AccProfile1 = " -e "
    Else
        $AccProfile1 = ""
    EndIf
;****************************************
    $State5 = GUICtrlRead ($IntractDesk)
    If $State5 = $GUI_CHECKED Then
        $IntractDesk1 = " -i "
    Else
        $IntractDesk1 = ""
    EndIf
;****************************************
    $State6 = GUICtrlRead ($CopyFileTo)
    If $State6 = $GUI_CHECKED Then
        $CopyFileTo1 = " -c "
        GUICtrlSetState ( $ForceCopy, $GUI_ENABLE )
        GUICtrlSetState ( $CopyIF, $GUI_ENABLE )
    Else
        $CopyFileTo1 = ""
        GUICtrlSetState ( $ForceCopy, $GUI_DISABLE )
        GUICtrlSetState ( $CopyIF, $GUI_DISABLE )
    EndIf
;****************************************
    $State7 = GUICtrlRead ($ForceCopy)
    If $State7 = $GUI_CHECKED Then
        $ForceCopy1 = " -f "
    Else
        $ForceCopy1 = ""
    EndIf
;****************************************
    $State8 = GUICtrlRead ($CopyIF)
    If $State8 = $GUI_CHECKED Then
        $CopyIF1 = " -v "
    Else
        $CopyIF1 = ""
    EndIf
;***************************************
    $State9 = GUICtrlRead ($TermiNate)
    If $State9 = $GUI_CHECKED Then
        $TermiNate1 = " -d "
    Else
        $TermiNate1 = ""
    EndIf
;**************************************
    $State10 = GUICtrlRead ($AppFile)
    If $State10 = $GUI_CHECKED Then
        $AppFile1 = GUICtrlRead ( $FileIn)
    Else
        $AppFile1 = ""
    EndIf
;**************************************
    $State11 = GUICtrlRead ($PPriority)
    If $State11 = $GUI_CHECKED Then
        $PPriority1 = GUICtrlRead ($PriorityValue)
    Else
        $PPriority1 = ""
    EndIf
;**************************************
    $State12 = GUICtrlRead ($ProcessorInf)
    If $State12 = $GUI_CHECKED Then
        $ProcessorInf1 = " -a " & GUICtrlRead ($Processor)
    Else
        $ProcessorInf1 = ""
    EndIf
;**************************************
    ;Sleep( 200 )
;**********Clock loop***********

    If $msg = -3 Then
        ExitLoop
    ElseIf $sec <> @SEC Then
        GUICtrlSetData($clocklabel, TimeSet())
        ;AlarmCheck(TimeSet())
    EndIf
Wend


Func TimeSet()
    $light = " AM"
    $hour = @HOUR
    $minute = @MIN
    $sec = @SEC
    If $hour = 0 Then
        $hour = 12
    ElseIf $hour = 12 Then
        $light = " PM"
    ElseIf $hour > 12 Then
        $hour = (@HOUR) - 12
        $light = " PM"
    EndIf
    $time = Chr(32) & $hour & ":" & $minute & ":" & $sec & $light
    Return $time
EndFunc ;==>TimeSet

Func SpecialEvents()
GuiSetState(@SW_HIDE, $mainwindow)
TraySetState(@SW_SHOW)
TraySetState(8)
;msgbox(0,"test", "Pram1")
;MsgBox(0,"specialEvent","dsadjdddlksajd")
EndFunc

Func Show()
GuiSetState(@SW_Show, $mainwindow)
Opt("TrayIconHide", 1)
;msgbox(0,"test", "Pram1")
;MsgBox(0,"specialEvent","dsadjdddlksajd")
EndFunc

Func ExitScript()
    Exit
EndFunc
Edited by Rahul Rohela

Share this post


Link to post
Share on other sites

I think no one has tested it... :lmao:

Share this post


Link to post
Share on other sites

I think no one has tested it... o:)

Nice :lmao:

I was going to write something like that by myself ;) will borrow some code if you dont mind :king:


There is a hex ( 31303030303030 ) reasons i love AutoIt !

Share this post


Link to post
Share on other sites

Do not forgot to post your final script.

Thx

Share this post


Link to post
Share on other sites

Here is the source....

Updates & Suggestions are Welcome..

[autoit]#include <GUIConstants.au3>

#Include <date.au3>

#include <Constants.au3>

Opt("TrayIconHide", 1)

Opt('TrayAutoPause', 0)

Opt("TrayOnEventMode",1)

Opt("TrayMenuMode",1)

TraySetState()

TrayCreateItem("")

$exititem = TrayCreateItem("Exit")

TrayItemSetOnEvent(-1,"ExitScript")

TraySetClick (8)

TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE,"Show")

$mainwindow = GUICreate( "Psexec GUI" , 860 , 365 , $WS_EX_ACCEPTFILES ) ; will create a dialog box that when displayed is centered

Dim $WshShell, $FileSystem, $CommandLine, $SysAccount, $AccProfile, $IntractDesk, $CopyFileTo, $RunCom

Dim $Pram1, $mainwindow, $DisplayHelp, $ProcessOptions, $PCName1, $UserName1, $UPwd1, $SysAccount1

Dim $AccProfile1, $IntractDesk1, $CopyFileTo1, $ForceCopy1, $CopyIF1, $TermiNate1, $AppFile1, $PPriority1, $ProcessorInf1

Dim $ForceCopy, $PPriority, $PriorityValue, $PCName, $PCid, $UserName, $UserID, $UPwd, $PassWd, $CopyIF

Dim $TermiNate, $AppFile, $FileIn, $Processor, $msg, $Chb_State, $State1, $State2, $State3, $State4, $State5

Dim $State6, $State7, $State8, $State9, $State10, $State11, $State12

Global $sec = @SEC, $minute, $hour, $light, $time, $clocklabel

$PCName = GUICtrlCreateCheckbox ("Type IP or PC Name e.g.\\PCname or \\PC's IP", 10, 10, 400, 20, $WS_TABSTOP)

$PCid = GUICtrlCreateInput ( "\\", 450, 10, 400, 20, $WS_TABSTOP )

GUICtrlSetTip($PCid,"Network PC name or IP starting with \\")

$UserName = GUICtrlCreateCheckbox ("Type User Name Domain\Username (-u)", 10, 33, 400, 20, $WS_TABSTOP)

$UserID = GUICtrlCreateInput ( "", 450, 33, 400, 20, $WS_TABSTOP )

GUICtrlSetTip($UserID,"LoginID")

$UPwd = GUICtrlCreateCheckbox ("Specifies optional password for user name.(-p)", 10, 56, 400, 20 )

$password = GUICtrlCreateInput ( "", 450, 56, 400, 20, $ES_PASSWORD )

GUICtrlSetTip($password,"Password of mentioned login. Else it will ask later")

$SysAccount = GUICtrlCreateCheckbox ("Run the remote process in the System account (-s)", 10, 79, 400, 20, $WS_TABSTOP)

$AccProfile = GUICtrlCreateCheckbox ("Loads the specified account's profile (-e)", 10, 102, 400, 20, $WS_TABSTOP)

$IntractDesk = GUICtrlCreateCheckbox ("interacts with the desktop (-i)", 10, 125, 400, 20, $WS_TABSTOP)

$CopyFileTo = GUICtrlCreateCheckbox ("Copy the specified program to the remote system (-c)", 10, 148, 400, 20, $WS_TABSTOP)

$ForceCopy = GUICtrlCreateCheckbox ("Copy the specified program even if the file already exists (-f)", 10, 171, 400, 20, $WS_TABSTOP)

$CopyIF = GUICtrlCreateCheckbox ("Copy the specified file only if it has a higher version number (-v)", 10, 194, 400, 20, $WS_TABSTOP)

$TermiNate = GUICtrlCreateCheckbox ("Don't wait for process to terminate (non-interactive) (-d)", 10, 217, 400, 20, $WS_TABSTOP)

$AppFile = GUICtrlCreateCheckbox ("Name of application to execute and Arguments", 10, 240, 400, 20, $WS_TABSTOP)

$FileIn = GUICtrlCreateInput ( "", 450, 240, 400, 20, $WS_TABSTOP )

GUICtrlSetTip($FileIn,"Command or EXE to execute. Must be in Path or provide Absolute path")

$PPriority = GUICtrlCreateCheckbox ( "Specifies -low, -belownormal, -abovenormal, -high or -realtime (-priority)", 10, 263, 400, 20, $WS_TABSTOP)

$PriorityValue = GUICtrlCreateCombo ( " -low", 450, 263, 100,200,$CBS_DROPDOWN, $WS_EX_OVERLAPPEDWINDOW )

GUICtrlSetData(-1," -belownormal| -abovenormal| -high| -realtime","")

GUICtrlSetTip($PriorityValue,"Set Priority ")

$ProcessorInf = GUICtrlCreateCheckbox ( "Separate processors on which the application can run with commas(-a)", 10, 286, 400, 20, $WS_TABSTOP)

$Processor = GUICtrlCreateInput ( "", 450, 286, 400, 20, $WS_TABSTOP )

GUICtrlSetTip($Processor,"Processor(s) to Use")

$DisplayHelp = GUICtrlCreateButton ("&Help", 450, 315, 50, 25, $WS_TABSTOP)

GUICtrlSetTip($DisplayHelp,"Psexec Command help, Click and know Switches")

$ProcessOptions = GUICtrlCreateButton ("&OK", 590, 315, 50, 25, $WS_TABSTOP)

GUICtrlSetTip($ProcessOptions,"Execute seletion")

$Closedown = GUICtrlCreateButton ( "&Close", 520, 315, 50, 25, $WS_TABSTOP )

GUICtrlSetTip($Closedown,"Close Window")

Func CmdRun()

;****************main command

StringIsSpace($Pram1)

$Pram1 = $PCName1 & $UserName1 & $UPwd1 & $SysAccount1 & $AccProfile1 & $IntractDesk1 & $CopyFileTo1 & $ForceCopy1 & $CopyIF1 & $TermiNate1 & $AppFile1 & $PPriority1 & $ProcessorInf1

$CommandLine = "psexec " & $Pram1

$RunCom = MsgBox (1, "This is the psexec command that you just configured:", "Do you want to execute it " & Chr(13) & Chr(13) & $CommandLine & Chr(10) & Chr(10))

If $RunCom = 1 Then

RunWait ( "cmd /t:9f /k" & $CommandLine )

Else

GUICtrlSetState ( $PCName, $GUI_FOCUS )

EndIf

EndFunc

;msgbox( 0, "output ", GUICtrlRead ($SysAccount))

;msgbox(0,"test", $CommandLine)

;****************Clock*****************

opt("WinWaitDelay", 100)

opt("WinTitleMatchMode", 4)

opt("WinDetectHiddenText", 1)

opt("MouseCoordMode", 0)

;GUICreate("Max's Clock", 200, 50, (@DesktopWidth - 188) / 2, (@DesktopHeight - 59) / 2)

$clocklabel = GUICtrlCreateLabel(" Loading...", 700, 320, 82, 19, 0x1000)

GUICtrlSetTip($clocklabel, _nowDate())

GUICtrlSetFont($clocklabel, 10)

;***************************************

GUISetState (@SW_SHOW)

While 1

$msg1 = TrayGetMsg()

$msg = GUIGetMsg()

;GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")

Select

;If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Case $msg = $GUI_EVENT_ClOSE

Exit

Case $msg = $Closedown

Exit

Case $msg = $DisplayHelp

RunWait ( "cmd /t:9f /k Psexec /?" ) ;***********Command execute*******

Case $msg = $ProcessOptions

Call("CmdRun")

Case $msg = $GUI_EVENT_MINIMIZE

Call("SpecialEvents")

;Case $msg1 = $exititem

;msgbox(0,"exit","sdljhashdljkh")

;ExitLoop

EndSelect

;*****************************************

$Chb_State = GUICtrlRead ($PCName)

If $chb_state = $GUI_UNCHECKED Then

$PCName1 = ""

ElseIf $chb_state = $GUI_CHECKED Then

$PCName1 = GUICtrlRead ($PCid)

Else ; (=$GUI_INDETERMINATE)

GUICtrlSetData($label,"n/a")

EndIf

;**********************************************

$State1 = GUICtrlRead ($UserName)

If $State1 = $GUI_CHECKED Then

$UserName1 = " -u " & GUICtrlRead ($UserID)

Else

$UserName1 = ""

EndIf

;**************************************

$State2 = GUICtrlRead ($UPwd)

If $State2 = $GUI_CHECKED Then

$UPwd1 = " -p " & GUICtrlRead ($password)

Else

$UPwd1 = ""

EndIf

;****************************************

$State3 = GUICtrlRead ($SysAccount)

If $State3 = $GUI_CHECKED Then

$SysAccount1 = " -s "

Else

$SysAccount1 = ""

EndIf

;****************************************

$State4 = GUICtrlRead ($AccProfile)

If $State4 = $GUI_CHECKED Then

$AccProfile1 = " -e "

Else

$AccProfile1 = ""

EndIf

;****************************************

$State5 = GUICtrlRead ($IntractDesk)

If $State5 = $GUI_CHECKED Then

$IntractDesk1 = " -i "

Else

$IntractDesk1 = ""

EndIf

;****************************************

$State6 = GUICtrlRead ($CopyFileTo)

If $State6 = $GUI_CHECKED Then

$CopyFileTo1 = " -c "

GUICtrlSetState ( $ForceCopy, $GUI_ENABLE )

GUICtrlSetState ( $CopyIF, $GUI_ENABLE )

Else

$CopyFileTo1 = ""

GUICtrlSetState ( $ForceCopy, $GUI_DISABLE )

GUICtrlSetState ( $CopyIF, $GUI_DISABLE )

EndIf

;****************************************

$State7 = GUICtrlRead ($ForceCopy)

If $State7 = $GUI_CHECKED Then

$ForceCopy1 = " -f "

Else

$ForceCopy1 = ""

EndIf

;****************************************

$State8 = GUICtrlRead ($CopyIF)

If $State8 = $GUI_CHECKED Then

$CopyIF1 = " -v "

Else

$CopyIF1 = ""

EndIf

;***************************************

$State9 = GUICtrlRead ($TermiNate)

If $State9 = $GUI_CHECKED Then

$TermiNate1 = " -d "

Else

$TermiNate1 = ""

EndIf

;**************************************

$State10 = GUICtrlRead ($AppFile)

If $State10 = $GUI_CHECKED Then

$AppFile1 = GUICtrlRead ( $FileIn)

Else

$AppFile1 = ""

EndIf

;**************************************

$State11 = GUICtrlRead ($PPriority)

If $State11 = $GUI_CHECKED Then

$PPriority1 = GUICtrlRead ($PriorityValue)

Else

$PPriority1 = ""

EndIf

;**************************************

$State12 = GUICtrlRead ($ProcessorInf)

If $State12 = $GUI_CHECKED Then

$ProcessorInf1 = " -a " & GUICtrlRead ($Processor)

Else

$ProcessorInf1 = ""

EndIf

;**************************************

;Sleep( 200 )

;**********Clock loop***********

If $msg = -3 Then

ExitLoop

ElseIf $sec <> @SEC Then

GUICtrlSetData($clocklabel, TimeSet())

;AlarmCheck(TimeSet())

EndIf

Wend

Func TimeSet()

$light = " AM"

$hour = @HOUR

$minute = @MIN

$sec = @SEC

If $hour = 0 Then

$hour = 12

ElseIf $hour = 12 Then

$light = " PM"

ElseIf $hour > 12 Then

$hour = (@HOUR) - 12

$light = " PM"

EndIf

$time = Chr(32) & $hour & ":" & $minute & ":" & $sec & $light

Return $time

EndFunc ;==>TimeSet

Func SpecialEvents()

GuiSetState(@SW_HIDE, $mainwindow)

TraySetState(@SW_SHOW)

TraySetState(8)

;msgbox(0,"test", "Pram1")

;MsgBox(0,"specialEvent","dsadjdddlksajd")

EndFunc

Func Show()

GuiSetState(@SW_Show, $mainwindow)

Opt("TrayIconHide", 1)

;msgbox(0,"test", "Pram1")

;MsgBox(0,"specialEvent","dsadjdddlksajd")

EndFunc

Func ExitScript()

Exit

EndFunc

Share this post


Link to post
Share on other sites

Very nice. I made a gui once too. It's called RemoteIt (it's incomplete) and it's in my signature if you want to compare. Good job.

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