Sign in to follow this  
Followers 0
jvanegmond

Process close, with delay and cancel.

7 posts in this topic

#1 ·  Posted (edited)

Select a process, type how many seconds you want it to wait and click close to close the process.

or type how many seconds you want to delay shutdown, and press cancel to abort shutdown.

Global Const $GUI_EVENT_CLOSE = -3

Dim $msg

GUICreate ( "Timer v. 0.1 !", 300, 310)
$mylist=GUICtrlCreateList ("", 10, 10, 200, 250)
$sleep = GUICtrlCreateInput ( "0", 10,  265, 200, 20)
$close=GUICtrlCreateButton("Close", 220, 10, 70)
$shutdown=GUICtrlCreateButton("Shutdown", 220, 40, 70)
$cancel=GUICtrlCreateButton("Cancel", 220, 70, 70)
GUICtrlCreateLabel ("Select a process, press Close to end it. Press cancel to stop shutdown. Type # of seconds left-down to delay.",  220, 100, 70, 200)
$time=GUICtrlCreateLabel("", 220, 300)
Get()
GUISetState ()

While $msg <> $GUI_EVENT_CLOSE
    $msg = GUIGetMsg()
    Select
        Case $msg = $close
            Sleep(GUICtrlRead($sleep) * 1000)
            ProcessClose( GUICtrlRead($mylist) )
            Get()
        Case $msg = $shutdown
            Run("Shutdown -s -t " & GUICtrlRead($sleep))
        Case $msg = $cancel
            Run("Shutdown -a")
    EndSelect
Wend
Exit

Func Get()
    $list = ProcessList() 
    for $i = 2 to $list[0][0]
        GUICtrlSetData($mylist,$list[$i][0])
    next
EndFunc

:o

Edited by Manadar

Share this post


Link to post
Share on other sites



If noone's gonna post i'll do it. At least it's not empty now. And the most pathethic thing probably is the fact that it'll just have 1 post now.

Share this post


Link to post
Share on other sites

nice one mate...it's useful...


I believe we should all pay our tax with a smile. I tried - but they wanted cash!

Share this post


Link to post
Share on other sites

Nice, simple and effective. Has a good looking small window also which I like.

Well done, Manadar

Share this post


Link to post
Share on other sites
it's really usefull :o

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Share this post


Link to post
Share on other sites

Useful unless like me you select shutdown instead of close. :">



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

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