home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
c
/
captask.zip
/
CAPTASK.WBT
< prev
next >
Wrap
Text File
|
1993-02-27
|
5KB
|
187 lines
; >>>>> CapTask <<<<<
; Bo Peng 2/15/93
;WinHide("Batch Runner")
;if StrIndex(IniReadPvt("boot","shell","progman","c:\win\system.ini"),"ndw",1,@FWDSCAN) != 0 then goto OK
;if StrIndex(IniReadPvt("boot","shell","progman","c:\win\system.ini"),"NDW",1,@FWDSCAN) != 0 then goto OK
;goto WrongShell
:OK
Exclusive(@OFF)
ErrorMode(@OFF)
IntControl(12, 1, 0, 0, 0)
n=0
; The product of "I" and the delay value (see later) tells CapTask how many
; seconds to wait before updating the time/res info on the caption bar.
; Decrease it if you have more CPU time to waste. In fact, I suspect
; the impact should be very minimal.
I=10
Tab=Num2Char(9)
Enter=Num2Char(13)
; Change the string between brackets if you don't like the name. But after
; you've changed names for this file AND captask.wbd
CapTask="CapTask"
; Replace DirHome() with the direcory name in double quotes if you decide
; not to put captask.wbt and captask.wbd in your NDW directory. Or simply
; give the actual full path name for captask.wbd.
WBD=StrCat(DirHome(),CapTask,".wbd")
Bare=WinGetActive()
Temp=Bare
:Title
dt1=DateTime()
dt=StrSub(dt1,1,StrLen(dt1)-6)
if StrIndex(dt1,"AM",1,@FWDSCAN) != 0 then goto AM
if StrIndex(dt1,"PM",1,@FWDSCAN) != 0 then dt=StrCat("[",dt,"pm ")
goto Res
:AM
dt=StrCat("[",dt,"am ")
:Res
m=WinResources(0)/1024
Full=StrCat(dt,StrCat(Min(WinResources(2),WinResources(3),WinResources(4)),"%% %m%K] - "),Bare)
WinTitle(Temp,Full)
:Wait
; The delay value tells CapTask how many seconds to wait before checking
; for mouse buttons. MUST be integer (bummer...).
Delay(1)
n=n+1
; MouseInfo(4)=1 means the RIGHT button is down. Change this if you want
; to use other buttons or combinations to activate the CapTaskMan.
if MouseInfo(4) == 1 then goto ChkM
if n != I then goto Wait
:ChkT
n=0
Temp=WinGetActive()
if WinState(Temp) == -1 then goto Wait
if StrIndex(Temp,Bare,1,@FWDSCAN) != 0 then goto Title
if WinExist(Full) then WinTitle(Full,Bare)
Bare=Temp
goto Title
:ChkM
if MouseInfo(1) == "" then goto TMan
if n != I then goto Wait
goto ChkT
:TMan
Sounds(0)
DialogBox(StrCat(CapTask," Task/Desktop Manager"),WBD)
if task == 1 then goto ChkD
if task < 5 then goto List
if task == 5 then goto Exit
if task == 6 then goto ExitWin
if task == 7 then goto Restart
:Reboot
Sounds(1)
if AskYesNo("REBOOT","Are you sure about rebooting the machine?") == @NO then goto ChkD
IntControl(67,0,0,0,0)
:ExitWin
Sounds(1)
if AskYesNo("EXIT WINDOWS","Are you sure about exiting Windows?") == @NO then goto ChkD
EndSession()
:Restart
Sounds(1)
if AskYesNo("RESTART WINDOWS","Are you sure about restarting Windows?") == @NO then goto ChkD
IntControl(66,0,0,0,0)
:List
Exclusive(@ON)
Display(1,"Compiling Task List","Just a coupl'o seconds...")
l=1
tList=""
WList=WinItemize()
j=ItemCount(WList,Tab)
:GetT
tLen=StrIndex(WList,Tab,l,@FWDSCAN)
t=StrSub(WList,l,tLen-l)
l=tLen+1
if StrIndex(t,"Delay Error",1,@FWDSCAN) != 0 then goto Skip
if WinState(t) == -1 then goto Hidden
t=StrCat("[s]--",t)
goto BuildList
:Hidden
t=StrCat("[h]--",t)
:BuildList
tList=StrCat(tList,t,Tab)
:Skip
j=j-1
if j != 0 then goto GetT
if task == 2 then goto SH
if task == 3 then goto CT
:Kill
t=ItemSelect("Select Task to Kill",tList,Tab)
if t == "" then goto ChkD
t=StrSub(t,6,StrLen(t)-5)
Sounds(1)
if AskYesNo("KILL TASK",StrCat("Are you sure you want to kill",Enter,"<< ",t," >>???")) == @YES then goto DoIt
; Change the message if you dislke the idea of a computer delivering a
; message from your God.
Display(2,"FATHER","Wise choice, mortal!")
goto ChkD
:DoIt
; Change the message if it makes you feel uneasy/nervous/outright scared.
Display(2,"COP","You're under arrest for attempted murder...")
WinClose(t)
goto ChkD
:CT
t=ItemSelect("Select Window to Change Title",tList,Tab)
if t == "" then goto ChkD
t=StrSub(t,6,StrLen(t)-5)
NewT=AskLine("Change Title",StrCat("New Title for",Enter,"<< ",t," >>"),"")
if NewT == "" then goto ChkD
WinTitle(t,NewT)
goto ChkD
:SH
t=ItemSelect("Select Task to Show/Hide",tList,Tab)
if t == "" then goto ChkD
State=StrSub(t,2,1)
t=StrSub(t,6,StrLen(t)-5)
if State == "h" then goto ShowH
WinHide(t)
goto ChkD
:ShowH
WinShow(t)
:ChkD
WinActivate(Full)
Sounds(1)
if desk == 1 then goto End
if desk == 2 then goto Stackem
if desk == 3 then goto Tilem
if desk == 4 then goto Rowem
if desk == 5 then goto Columnem
:Arrangem
IconArrange()
goto End
:Stackem
WinArrange(@STACK)
goto End
:Tilem
WinArrange(@TILE)
goto End
:Rowem
WinArrange(@ROWS)
goto End
:Columnem
WinArrange(@COLUMNS)
:End
Exclusive(@OFF)
if n != I then goto Wait
goto ChkT
:Exit
Sounds(1)
if AskYesNo(StrCat("EXIT ",CapTask),StrCat("Are you sure about terminating ",CapTask,"?")) != @YES then goto ChkD
if WinExist(Full) then WinTitle(Full,Bare)
exit
:WrongShell
Display(2,"WRONG SHELL",StrCat(CapTask," will only run if the Norton Desktop is your shell."))
exit