forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Closing a curtain

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Wed Mar 21, 2007 11:45 am    Post subject: Closing a curtain Reply with quote

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...
Back to top
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Thu Mar 22, 2007 3:27 am    Post subject: Reply with quote

I'd just monitor if the dos window is still open (and close the vds app once the dos window closes):

Code:
    while @winexists(#DOS Window Name)
      wait 1
    wend
    stop


Or if the curtain window has a close button:

Code:
    while @winexists(#DOS Window Name)
      wait 1
      # Check if Close button pressed
      %e = @event()
      if @equal(%e,CLOSE)
        stop
      end
    wend
    stop

_________________
cheers

Dave
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group