dmonckton Contributor


Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Wed Mar 21, 2007 11:45 am Post subject: Closing a curtain |
|
|
Hi All
I've written a VDS curtain script for my collegue to use whilst he runs
a noisey batch file so that users cannot see what is going on. The only
problem is I don't know how to end the curtain program from the batch
file once it is running. I thought about killing the task but this means I'll
have to create another exe to call from the batch file. Is there a better
way to stop the curtain.
Here is the script...
| Code: |
option scale,96
rem enable windows to shutdown whilst curtain is up
option shutdown,close
option decimalsep,"."
%%width = @sysinfo(screenwidth)
%%height = @sysinfo(screenheight)
rem set text box width to be 50% of screen width
%%textWidth = @fmul(%%width,0.5)
rem set the text element left indent so that text is centered
%%textLeft = @div(@diff(%%width,%%textWidth),2)
rem set the text element height so that it can centered
%%textHeight = 25
rem set the text element top so that text is centered
%%textTop = @div(@diff(%%height,%%textHeight),2)
rem set progess bar width to be 50% of screen width
%%progWidth = @fmul(%%width,0.5)
rem set the progess element left indent so that text is centered
%%progLeft = @div(@diff(%%width,%%progWidth),2)
rem set the progress element height so that it can centered
%%progHeight = 25
rem set the progess element top so that it is 50 pixels below the text
%%progTop = @sum(%%textTop,50)
rem supply own text at command-line or use default
if %1
%%title = %1
else
%%title = Please wait updating operating system
end
Title Curtain
DIALOG CREATE,I.T. Services,-1,0,%%width,%%height,NOTITLE,COLOR BLACK,ONTOP
DIALOG ADD,STYLE,STYLE2,,,,BLACK,GREEN
DIALOG ADD,STYLE,STYLE1,Verdana,14,C,BLACK,WHITE
DIALOG ADD,TEXT,MESSAGE,%%textTop,%%textLeft,%%textWidth,%%textHeight,%%title,,STYLE1
DIALOG ADD,PROGRESS,PROGRESS1,%%progTop,%%progLeft,%%progWidth,%%progHeight,0,,STYLE2
DIALOG SHOW
%%bar = 0
:Evloop
wait event,0.3
goto @event()
exit
:Timer
%%bar = @succ(%%bar)
if @equal(%%bar,101)
%%bar = 0
end
if @equal(%%bar,15)
rem THIS IS A GETOUT CLAUSE REMOVE WHEN IN USE
dialog close
end
DIALOG SET,PROGRESS1,%%bar
goto evloop
:close
exit
|
Thanks
David... |
|