#129002 - 2004-11-04 03:16 PM
MESSAGEBOX help
|
Anonymous
Anonymous
Unregistered
|
Hi, I'm still a bit n00by when it comes to Kix.
What I am trying to do is run a Messagebox which is time lapsed.......whilst this messagebox ("please wait...") is running, run a batch file which deletes some files, and once that is done, return to another Messagebox how many files have been deleted, or that simply knows the deletion has finished and displays a message (such as "Files deleted - Continuing with Logon")
anyone help me please. I cant seem to get the style without any boxes on. Haven't even got to the second messagebox.
Cheers Wiggz
|
|
Top
|
|
|
|
#129005 - 2004-11-04 03:40 PM
Re: MESSAGEBOX help
|
Anonymous
Anonymous
Unregistered
|
Yea sounds like Kixforms would be overkill.
And I cn make the Box Dissappear by itself without the user pressing ok though. So the user doesn't have to dismiss it!
In that case...say i give them Msgbox1 which says "Deleteing Files press OK".....they press ok.....and then another box comes up and says files deleted
1) how do I do that and, 2) could I add any event data to that second box such as how many files have been deleted
cheers
Wiggzz
|
|
Top
|
|
|
|
#129008 - 2004-11-04 04:01 PM
Re: MESSAGEBOX help
|
Anonymous
Anonymous
Unregistered
|
See this is the problem, I dont understand anything you just did above )
Wiggz
|
|
Top
|
|
|
|
#129010 - 2004-11-04 04:09 PM
Re: MESSAGEBOX help
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
hmmm, this line here:
$answer = MessageBox("Deleteing Files press OK...", "", 0)
Displays a messagebox with specified text, and an OK button, and asks the user to press OK, when they do - control is returned back to your script, where you delete the files, at the end this:
$answer = MessageBox("files deleted. press OK...", "", 0)
displays another messagebox saying files deleted, the user has to press OK again, and the login script carrys on ...
The second parameter to Messagebox ("") is the title, i just used a null string for that, and the third param (0), specifies all the various flavors and options for Messagebox (buttons, icons, etc). I just used zero which means take all the defaults.
While your reading the manual, might want to look at the option to have timeouts on the MessageBox ... important stuff for login scripts maybe.
|
|
Top
|
|
|
|
#129013 - 2004-11-04 04:32 PM
Re: MESSAGEBOX help
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Here is an example of a messagebox using IE:
Code:
$oIE=funMakeIE("Countdown timer demo",150,400)
For $i = 10 To 0 Step -1
Select
Case $i<3 $COLOUR="RED"
Case $i<6 $COLOUR="YELLOW"
Case "Default" $COLOUR="GREEN"
EndSelect
$oIE.document.body.innerHTML="<CENTER><FONT COLOR="+$COLOUR+" SIZE=7>Countdown: "+$i+"</FONT></CENTER>"
Sleep 0.5
Next
$oIE.document.body.innerHTML="<CENTER><FONT COLOR=RED SIZE=7><B>**BOOM**</B></FONT></CENTER>"
Sleep 3
$oIE.Quit
$oIE=0
Exit 0
; -------------------------------------------------------
; Ignore everything below here - this is black-box magic.
; -------------------------------------------------------
Function funMakeIE($sTitle,$iHeight,$iWidth)
$funMakeIE=CreateObject("InternetExplorer.Application")
If $funMakeIE
; Remove clutter
$funMakeIE.toolbar=0 $funMakeIE.menubar=0 $funMakeIE.addressbar=0 $funMakeIE.statusbar=0
; Load dummy
$funMakeIE.navigate("about:blank")
funWait($funMakeIE)
Else
funError("Cannot create IE object")
Exit 1406
EndIf
$funMakeIE.document.write("<HTML>
<HEAD>
<!--
Hand crafted script
Created R. Howarth March 2004
-->
<TITLE>"+$sTitle+"</TITLE>
<SCRIPT Language=JavaScript>
function funDispatcher(s){
frmMain.sStatus.value+=s+';';
}
function funGetScreenSize(){
frmMain.screenheight.value=screen.availHeight;
frmMain.screenwidth.value=screen.availWidth;
}
</SCRIPT>
</HEAD>
<BODY onLoad='funGetScreenSize();' BGCOLOR=LIGHTGREY>
<FORM Name=frmMain>
<INPUT Type=Hidden Name=screenheight Value=''>
<INPUT Type=Hidden Name=screenwidth Value=''>
</FORM>
</BODY>
</HTML>")
$funMakeIE.refresh()
funWait($funMakeIE)
$funMakeIE.height=$iHeight
$funMakeIE.width=$iWidth
$funMakeIE.left=(Cint($funMakeIE.document.frmMain.screenwidth.value)-$iWidth)/2
$funMakeIE.Top=(Cint($funMakeIE.document.frmMain.screenheight.value)-$iHeight)/2
$funMakeIE.visible=1
funWait($funMakeIE)
$=SetFocus($TITLE)
$funMakeIE.visible = 1
Exit 0
EndFunction
Function funWait($oIE)
While $oIE.busy AND $oIE.readystate <> 4 AND @error = 0 Loop
EndFunction
It may look a bit complicated, but you don't need to know how the functions work - just follow what is going on in the first dozen lines or so.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1376 anonymous users online.
|
|
|