MSFN Forum: HTA Animation - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

HTA Animation Rate Topic: -----

#1 User is offline   dcistech 

  • Group: Members
  • Posts: 8
  • Joined: 10-May 12
  • OS:none specified
  • Country: Country Flag

Posted 22 May 2012 - 10:44 AM

First off: I'm a bit of a novice. I know enough to make sense of most simple written code (most of the time), but I'm not all that experienced. So, this issue is likely very silly, but I've searched for a solution for a few hours now and can't find one.

Anyway, I'm working on modifying an HTA to show a second HTA (with an animation) while the main HTA doing whatever it's doing at the time. However, I'm having trouble getting the new animation HTA to close when the main HTA completes its task. Since the main HTA locks up until it finishes its task, I've tried simply adding an objShell.run before the task and an ObjShell.terminate after the task. However, since it's running from an HTA, the terminate command doesn't seem to want to work, and always throws up an error. I've also attempted switching to a simple animated .gif and using window.open("animated.gif") and window.close("animated.gif"). While that works, the inability to completely remove the border etc is really annoying and not ideal. I have an HTA already made to the specifications I want, I just can't get it to close once its opened.

Any ideas?


#2 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,669
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 22 May 2012 - 01:58 PM

FYI: This discussion is a more code-oriented split off of the OP trying to adapt the GImageX HTA to show "something" for progress. Here is where that discussion starts:
http://www.msfn.org/...post__p__997759

As I mentioned in the other thread, you'll need to have your HTA check for the presence of a process and then execute the window.close once it is determined that said process isn't running anymore. As for how to do this in VBScript, I couldn't tell you.

Here is an example of how to use WMI with VBScript to verify if a process is present, however its a one time check.
http://www.wisesoft....is_running.aspx

So let's take a look at the old code that doesn't work. How exactly this translates into the gray box, I'm not sure, but I would imagine parts of this code could be used to show an HTA instead since it already does appear (usually) when the drive is being imaged. So getting this to show an animation would certainly be easier.

progress.style.visibility = "visible"
          progress.innerHTML = "<table border='0'><tr><td>Percents completed: </td><td>Calculating</td></tr><tr><td>Time remaining: </td><td>Calculating</td></tr></table>"


Now there are two Progress functions at the bottom of the HTA but they aren't called anywhere in the code.

#3 User is offline   dcistech 

  • Group: Members
  • Posts: 8
  • Joined: 10-May 12
  • OS:none specified
  • Country: Country Flag

Posted 22 May 2012 - 03:35 PM

Thanks Tripredacus, apparently I didn't see your post before splitting off here. From my research, it looks like the progress bar code will not work in an HTA because IE stops rendering while the HTA does its thing--hence my attempt to create a pop-up status animation that just lets you know something is happening. My reasoning for making it an HTA rather than a plain .gif (other than the annoying IE frame) being that I eventually want it to display different text depending on the operation--text that could be overlayed onto a generic processing gif. Probably via some sort of create-as-you-go secondary HTA that gets supplied certain variables and then opened.

Here is the super simple animation HTA I've put together:
<html>
<HEAD>
<title>Processing</title>
<HTA:APPLICATION
	BORDER = none
	APPLICATION = yes
	WINDOWSTATE = normal
	INNERBORDER = no
	SHOWINTASKBAR = no
	SCROLL = no
	APPLICATIONNAME = "Processing"
	NAVIGABLE = yes>
</HEAD>
<script LANGUAGE="VBScript">
Sub Window_onLoad
	strComputer = "."
	Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
	Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
	For Each objItem in colItems
		intHorizontal = objItem.ScreenWidth
		intVertical = objItem.ScreenHeight
	Next
	intLeft = (intHorizontal - 400) / 2
	intTop = (intVertical - 200) / 2
	window.resizeTo 400,200
	window.moveTo intLeft, intTop
End Sub
</SCRIPT>
<body background = "pics\processing.gif">
</BODY>
</HTML>



As you can see, it's nothing at all complicated.

In replacing the original status bar bits that aren't working I've done something simple like this:
					Start_Processing
					objWIM.ApplyImage
					End_Processing



Start_Processing and End_Processing are both subs I created. My most recent attempt looked like this:
Sub Start_Processing
	Dim processing_hta
	Set processing_hta = objShell.run("processing.hta")
End Sub
Sub End_Processing
	If processing_hta.status = 0 Then processing_hta.Terminate()
	Set processing_hta = Nothing
End Sub



The HTA opened, but got somewhat angry when it was then instructed to close.


The original progress subs trip mentioned are here:
Sub objWIM_Progress(Percent,TimeRemaining)
On Error Resume Next
objShell.Popup Percent, 1, "Title", -1
If Percent = 100 Then
progress.innerHTML = "<table border='0'><tr><td>Percents completed: </td><td>100 % </tr><tr><td>Time remaining: </td><td>0 min 0 sec</td></tr></table>"
Exit Sub
Else
Call ProgressHelper(Percent,TimeRemaining)
End If

End Sub

Sub ProgressHelper(pr,tr)
On Error Resume Next
intFMin = (tr MOD 3600) \ 60
intFSec = (tr MOD 3600) MOD 60
progress.style.visibility = "visible"
progress.innerHTML = "<table border='0'><tr><td>Percents completed: </td><td>" & pr & "%" & "</td></tr><tr><td>Time remaining: </td><td>" & intFMin & " min " & intFSec & " sec</td></tr></table>"
If pr = 100 Then
window.clearInterval(iTimerID)
progress.innerHTML = "<table border='0'><tr><td>Percents completed: </td><td>100 % </tr><tr><td>Time remaining: </td><td>0 min 0 sec</td></tr></table>"
Else
Exit Sub
End If

End Sub



And the same bit of code I posted that attempts to open and close the progress HTA looks like this in the original:
          progress.style.visibility = "visible"
          progress.innerHTML = "<table border='0'><tr><td>Percents completed: </td><td>Calculating</td></tr><tr><td>Time remaining: </td><td>Calculating</td></tr></table>"
          objWIM.ApplyImage



So ya, that's just about everything, aside from looking at the original HTA itself. I can't make heads or tails of the original status bar stuff, and on my end, the gray window trip mentioned is just the after-affect of an earlier HTA being opened and then closed right as the main HTA stops rendering (leaving behind a "shadow" box"). Which make sense if the info I've found is correct and HTA windows stop rendering during tasks.

#4 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,669
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 23 May 2012 - 02:26 PM

I think you need to get the function of closing the progress HTA out of the main HTA and into the progress HTA. That should have no problem closing itself. Like I said, I don't use VBScript much at all, however here is a general method of what I am thinking:

1. Wait for imagex.exe process to exist.
2. Wait until imagex.exe exits.
3. Sleep 1-5 seconds.
4. invoke window.close()

Now the only app I currently have that waits for a process to close concerns MSIEXEC and it behave differently than imagex does.

Another possibility is to move the actuall imaging commands into the progress HTA, so it would be easier (I hope) for that to know when the imaging is done. This was what I did when I created a custom recovery partition that included a main HTA that launched a "progress" HTA. Here is it (with commands changed to xxx)

<Title>full</Title>
  <HTA:APPLICATION ID="FsSplashScreen"
   SCROLL="No"          
   SCROLLFLAT ="No"  
   SingleInstance="Yes"  
   ShowInTaskbar="No"          
   SysMenu="No"          
   MaximizeButton="No"        
   MinimizeButton="No"    
   Border="none"
   BORDERSTYLE ="complex"
   INNERBORDER ="No"  
   Caption="no"          
   WindowState="Normal"
   APPLICATIONNAME="FsCommandHta"
   CONTEXTMENU="no" 
   Icon="%SystemRoot%\explorer.exe">
<STYLE type="text/css">
    BODY  
    {
     Font:9.25pt;
     Font-weight:bold;
     Font-family:helvetica,verdana,arial;
     Color:#000080;
     Text-Align:Center;
     Vertical-Align:Middle;
     Padding-Top:3;
     Padding-Bottom:2;
     Padding-Left:10;
     Padding-Right:10;
	 background-image:url('resources\animation.gif')
    }
</STYLE>
<script Language='VBSCRIPT'>
'-> Resize And Move Window
  Dim Wth :Wth = int(250)
  Dim Hht :Hht = int(50)
  window.ResizeTo Wth, Hht
  MoveTo ((Screen.Width / 2) - (Wth / 2)),((Screen.Height / 2) - (Hht / 2))
  Dim Tmr
  Sub confirmation2
  Dim A1 :A1  = MsgBox("Recovery Complete, Click the Restart button to continue.")
    If A1 = True Then CreateObject("WScript.Shell").run "fscommand\restart.exe",0,True
End Sub
'-> Start The First Timer OnLoad, Three Second Wait Befor It Goes
'-> To The ClearTimer Function
   Function Window_OnLoad()
    document.focus()
    Txt1.innerHTML= "Processing The Script Function Please Wait"
    Tmr=setTimeout("ClearTimer()",3000)
   Exit Function
   End Function
'-> Process The First Command
   Function ClearTimer()
   '-> Object To Run The First Command Hidden, Uncooment To Make Active
   	Set objShell = CreateObject("WScript.Shell")
	ObjShell.run "xxx",0,True
	ObjShell.run "xxx",0,True
	ObjShell.run "xxx",0,True
	ObjShell.run "xxx",0,True
	Tmr=clearTimeout("")
    '-> Place Your Code For confirmation2 Here Start
	Call confirmation2()
    '-> Place Your Code For confirmation2 Here End
    Txt1.innerHTML= "Prepaparing To Close"
    Tmr=setTimeout("ClearTimer2()",3000)
   Exit Function
   End Function
'-> Close The Hta Function
   Function ClearTimer2()
   Tmr=clearTimeout("")
   window.close()
   Exit Function
   End Function
</SCRIPT>
<BODY Scroll='No'><TABLE><SPAN ID='Txt1'> </SPAN></TABLE></BODY>


You'll hate me for now remembering what all this code means. I built it, and then the entire concept failed regression testing and the concept was scrapped. So for example, you'll see there is a mention of a restart.exe in there. I do not know how that is called in this.

The main HTA launches this progress HTA using the following function:

Sub RunFull
	Set objShell = CreateObject("WScript.Shell")
	ObjShell.Run "mshta x:\windows\system32\full.hta",1,True
		On Error Resume Next
	Set objShell = Nothing
End Sub


#5 User is offline   dcistech 

  • Group: Members
  • Posts: 8
  • Joined: 10-May 12
  • OS:none specified
  • Country: Country Flag

Posted 25 May 2012 - 09:33 AM

Thanks for the tips. The processing HTA is now set up to check whether a particular process is running, and close if it isn't. I've been testing it with notepad since I wasn't wanting to deal with the main HTA until I knew my processing HTA was working. From what I can tell, the processing HTA works flawlessly. Here it is looking for notepad.exe:

<html>
<HEAD>
<title>Processing</title>
<HTA:APPLICATION
	BORDER = none
	APPLICATION = yes
	WINDOWSTATE = normal
	INNERBORDER = no
	SHOWINTASKBAR = no
	SCROLL = no
	APPLICATIONNAME = "Processing"
	NAVIGABLE = yes>
</HEAD>
<script LANGUAGE="VBScript">
'--------------------------------------------------------------
'Globals
'--------------------------------------------------------------
Set objWMIService = GetObject ("winmgmts:\\.\root\cimv2")
'--------------------------------------------------------------
'Window_onLoad (Resize and center window)
'--------------------------------------------------------------
Sub Window_onLoad
	strComputer = "."
	Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
	Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
	For Each objItem in colItems
		intHorizontal = objItem.ScreenWidth
		intVertical = objItem.ScreenHeight
	Next
	intLeft = (intHorizontal - 400) / 2
	intTop = (intVertical - 200) / 2
	window.resizeTo 400,200
	window.moveTo intLeft, intTop
End Sub
'--------------------------------------------------------------
'Waiting for GImageX_COM to start the process
'--------------------------------------------------------------
idTimer = window.setTimeout("Status_Check", 10000, "VBScript")
'--------------------------------------------------------------
'Check status of operation
'--------------------------------------------------------------
Sub Status_Check
	window.clearTimeout(idTimer)
	GImageXStatus = Not Running
	strComputer = "."
	Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
	Set colProcessList = objWMIService.ExecQuery("SELECT * FROM Win32_Process")
	For Each objProcess in colProcessList
		If objProcess.Name = "notepad.exe" Then
			GImageXStatus = Running
		End If
	Next
	If GImageXStatus = Running Then
		idTimer = window.setTimeout("Status_Check", 5000, "VBScript")
	Else
		Window.Close
	End If
End Sub
</SCRIPT>
<body background = "pics\processing.gif">
</BODY>
</HTML>



Basically, I open it, have it wait ten seconds (waiting in an HTA is annoying because wscript.sleep doesn't work), and then have it look for notepad.exe. If it finds it running, it sets an already defined variable to say "running" (it defaults to "not running") and then waits another five seconds before checking again. Once it does not find notepad.exe running, it closes. It's all pretty awesome.

One problem: GImageX_COM does not create a separate process for its tasks. They all run under the original mshta.exe. So... ya.

#6 User is offline   dcistech 

  • Group: Members
  • Posts: 8
  • Joined: 10-May 12
  • OS:none specified
  • Country: Country Flag

Posted 29 May 2012 - 08:31 AM

Ok, so I've made a temporary fix barring someone with a more legit idea coming around and sharing it with us. Since the processing HTA can't simply check for the GImageX process, I've "beefed up" the processing subs in the main HTA to create and delete a processing.txt file. The processing HTA then checks for this file--if it exists, it waits five seconds and runs the check again. If the file does not exist, the processing HTA closes. It's roughly equivalent to looking for an elephant by checking for piles of crap, but whatever. It works.

If anyone cares, this is what the processing subs look like right at this minute:
Sub Start_Processing
	Set SysFolder = Objfso.GetSpecialFolder(1)
	objFSO.CreateTextFile(SysFolder & "\processing.txt")
	objShell.run("processing.hta")
End Sub
Sub Stop_Processing
	Set SysFolder = Objfso.GetSpecialFolder(1)
	objFSO.DeleteFile(SysFolder & "\processing.txt")
End Sub



Obviously, both subs have to be run for the whole thing to work--the start sub before a given process, the stop sub after a given process.

And here's the simple processing HTA:
<html>
<HEAD>
<title>Processing</title>
<HTA:APPLICATION
	BORDER = none
	APPLICATION = yes
	WINDOWSTATE = normal
	INNERBORDER = no
	SHOWINTASKBAR = no
	SCROLL = no
	APPLICATIONNAME = "Processing"
	NAVIGABLE = yes>
</HEAD>
<script LANGUAGE="VBScript">
'--------------------------------------------------------------
'Globals
'--------------------------------------------------------------
Set objWMIService = GetObject ("winmgmts:\\.\root\cimv2")
Set objFso = CreateObject("Scripting.FileSystemObject")
'--------------------------------------------------------------
'Window_onLoad (Resize and center window)
'--------------------------------------------------------------
Sub Window_onLoad
	strComputer = "."
	Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
	Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
	For Each objItem in colItems
		intHorizontal = objItem.ScreenWidth
		intVertical = objItem.ScreenHeight
	Next
	intLeft = (intHorizontal - 400) / 2
	intTop = (intVertical - 200) / 2
	window.resizeTo 400,200
	window.moveTo intLeft, intTop
End Sub
'--------------------------------------------------------------
'Waiting for GImageX_COM to start the process
'--------------------------------------------------------------
idTimer = window.setTimeout("Status_Check", 10000, "VBScript")
'--------------------------------------------------------------
'Check status of operation
'--------------------------------------------------------------
Sub Status_Check
	window.clearTimeout(idTimer)
	Set objFso = CreateObject("Scripting.FileSystemObject")
	Set SysFolder = Objfso.GetSpecialFolder(1)
	If objFso.FileExists(SysFolder & "\processing.txt") Then
		idTimer = window.setTimeout("Status_Check", 5000, "VBScript")
	Else
		Window.Close
	End If
End Sub
</SCRIPT>
<body background = "pics\processing.gif">
</BODY>
</HTML>



I'm still planning on having the main HTA create the processing HTA with custom text each time it runs, but for now, I'm leaving it as is, and adding the sub calls before/after all the major processes in the main HTA.

This post has been edited by dcistech: 29 May 2012 - 08:46 AM


#7 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,669
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 29 May 2012 - 02:44 PM

Hmmm if it helps any, here is some AutoIT code that mentions the Progress tracking ability of the GImagex_COM.dll.

Set objWIM = WScript.CreateObject("GImageX.GImageXCtrl", "objWIM_")

objWIM.Source = "test.wim"
objWIM.Destination = "c:\test"
objWIM.ImageIndex = 1
objWIM.Check = TRUE
objWIM.Verify = TRUE
objWIM.ApplyImage

WScript.DisconnectObject objWIM
Set objWIM = Nothing


Sub objWIM_Progress(Percent, TimeRemaining)
    WScript.Echo Percent & "% - " & TimeRemaining & " sec(s)"
    ' Abort the operation by using the line below
    'objWim.Abort = TRUE
End Sub

Sub objWIM_ProgressInfo(Info)
    WScript.Echo Info
End Sub


This should look familiar as it looks like Geezery adapted the DLL functions (including example names) to VBScript for this HTA. A user on AutoIT forums have reported his VBScript example works, but the AutoIT one does not. Take a look (although the VBScript example is further up)
http://www.autoitscr...post__p__784958

#8 User is offline   allanf 

  • Junior
  • Pip
  • Group: Members
  • Posts: 66
  • Joined: 01-June 07

Posted 08 June 2012 - 12:42 AM

The problem with HTAs is that they become unresponsive when performing certain tasks. An HTA can open a reliable Modeless Dialogue Window to show activity.

See how the script and style for the Modeless Dialogue Window can be written on-the-fly by the HTA, such that there is no need for more than one file - the main HTA.

objProgressWindow.document.write ProgressHTML.innerHTML

where "ProgressHTML" is enclosed in XML tags within the body of the HTA.

<html>
	<head>
		<meta http-equiv="x-ua-compatible" content="ie=9">
		<script type="text/vbscript">

			HTAResize

			'********************************************************************************'
			'*Before HTA starts, resize screen.                                             *'
			'********************************************************************************'
			Sub HTAResize
				window.resizeTo 800,640
				intHorizontal = Document.ParentWindow.Screen.AvailWidth
				intVertical = Document.ParentWindow.Screen.AvailHeight
				intLeft = (intHorizontal - 800) / 2
				intTop = (intVertical - 640) / 2     
				'move to centerscreen
				window.moveTo intLeft, intTop
			End Sub

		</script>
		<hta:application
			id="htaHTA"
			applicationname="WinRE-O-Matic"
			border="dialog"
			maximizebutton="no"
			minimizebutton="no"
			scroll="auto"
		</hta:application>
		<script type="text/vbscript">
			
			Sub window_onLoad
				window.setTimeout "OpenProgressWindow", 0, "VBScript"
			End Sub

			'********************************************************************************'
			'*Progress bar.                                                                 *'
			'********************************************************************************'
			Dim objProgressWindow

			Sub OpenProgressWindow
				intProgBarWidth = CInt(document.documentElement.clientWidth)
				intProgBarHeight = 18
				intLeft = window.screenLeft
				intTop = window.screenTop + document.documentElement.clientHeight _
					- intProgBarHeight
				strOptions = "dialogWidth:" & intProgBarWidth _
					& "px; dialogHeight:" & intProgBarHeight & "px; dialogLeft: " _
						& intLeft & "; dialogTop: " & intTop & "; unadorned: yes; scroll: no;"
				Set objProgressWindow = _
					window.showModelessDialog("about:blank", self, strOptions)
				objProgressWindow.document.write ProgressHTML.innerHTML
				strTimedIterations = "TimedIterations" _
					& "(" & Chr(34) & intProgBarWidth & Chr(34) & ")"
				objProgressWindow.setTimeout strTimedIterations, 10, "VBScript"
			End Sub

			Sub CloseProgressWindow
				objProgressWindow.close
			End Sub

		</script>
	</head>
	<body>
		<xml id="ProgressHTML">
			<html>
				<head>
					<script language="vbscript">

						intCounter = 0
						window.returnValue = self

						Sub TimedIterations(fullWidth)
							intFullWidth = CInt(fullWidth)
							intBarBlockWidth = 150
							If intCounter < intBarBlockWidth Then
								spnBar1.style.width = intCounter
							Else
								spnBar2.style.width = intCounter - intBarBlockWidth
								If intCounter > intFullWidth Then
									spnBar1.style.width = intBarBlockWidth - (intCounter - intFullWidth)
									If intCounter = intFullWidth + intBarBlockWidth Then
										spnBar2.style.width = 0
										intCounter = 0
									End If
								End If
							End If
							intCounter = intCounter + 1
							strTimedIterations = "TimedIterations" _
								& "(" & Chr(34) & intFullWidth & Chr(34) & ")"
							window.setTimeout strTimedIterations, 1, "VBScript"
						End Sub

					</script>
				</head>
				<body style="background-color: #FFC106; cursor: wait; border: none;">
					<span id="spnBar2" style="background-color: #FFC106;">
					</span>
					<span id="spnBar1" style="background-color: green;">
					</span>
				</body>
			</html>
		</xml>
	</body>
</html>


BTW, as a demonstration, there is nothing in this code to cause the Modeless Dialogue Window (the Indeterminate Progress Bar) to close.

#9 User is online   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,351
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 08 June 2012 - 03:27 PM

This is just a simple Demo of a self closing Menu with a 5 second count down
You could have your progress bar where the count down is appearing.

Save As DemoPopupMenu.hta
Attached File  Popup_Demo_Timer.png (30.57K)
Number of downloads: 2
 <HTA:APPLICATION ID="DemoMenuTimer" 
   SCROLL="No"		   
   SCROLLFLAT ="No"  
   SingleInstance="Yes"   
   ShowInTaskbar="Yes"		   
   SysMenu="Yes"		  
   MaximizeButton="No"		
   MinimizeButton="No"	
   Border="Thin" 
   BORDERSTYLE ="complex" 
   INNERBORDER ="No"  
   Caption="Yes"		  
   WindowState="Normal" 
   APPLICATIONNAME="MainApp"
   Icon="%SystemRoot%\explorer.exe">
<TITLE>Demo Popup Menu Self Close</TITLE>
<!-- For Menu BackGround Dark To Light
  #D2B48C = Tan
  #FAF0E6 = Linen 
  #FFFFF0 = Ivory 
-->
<STYLE type="text/css">
  Body
   {
    Font-Size:9.25pt;
    Font-Weight:Bold;
    Font-Family:Segoe Ui, Arial,Tahoma,Comic Sans MS;
    Color:Black;
    BackGround-Color:#EFE9E3;
    Margin-Top:21;
    Margin-Bottom:1;
    Margin-Left:4;
    Margin-Right:4;
    Padding-Top:1;
    Padding-Bottom:1;
    Padding-Left:4;
    Padding-Right:4;
    Text-Align:Center;
    Vertical-Align:Top;
    Border-Top:0px Transparent;
    Border-Bottom:0px Transparent;
    Border-Left:0px Transparent;
    Border-Right:0px Transparent;
   }
  Div.Menu1
   {
    Font-Size:8.05pt;
    Font-Weight:Bold;
    Font-Family:Segoe Ui, Arial,Tahoma,Comic Sans MS;
    Color:Black;
    BackGround-Color:Transparent;
    Filter:progid:DXImageTransform.Microsoft.Gradient
    (StartColorStr='#FFFFF0',EndColorStr='#D2B48C');
	  Border-Left: 1px Dot;  
	  Border-Right: 2px Sunken;
	  Border-Top: 1px Dot;   
	  Border-Bottom: 2px Sunken;
    Text-Align:Center;
	  Margin:1;
	  Padding:2;
   }
  TD
   {
    Font-Size:8.05pt;
    Font-Weight:Bold;
    Font-Family:Segoe Ui, Arial,Tahoma,Comic Sans MS;
    Color:Black;
   }
  BUTTON
   { 
	  Height:18pt;  
	  width:61pt;
	  Cursor:Hand;
	  Font:8.05pt;
	  Font-weight:bold;
	  Font-Family:Segoe Ui, Arial,Tahoma,Comic Sans MS;
	  Color:#404040;
	  Text-Align:Center;
	  Vertical-Align:Middle;
	  filter:progid:DXImageTransform.Microsoft.Gradient
	  (StartColorStr='#E5E5E5',EndColorStr='#7D7D7D');
	  Margin:1;
	  Padding:2;
	  Border-Left: 1px Transparent;  
	  Border-Right: 2px Transparent;
	  Border-Top: 1px Transparent;   
	  Border-Bottom: 2px Transparent;
   }
</STYLE>
  <script Language='VBSCRIPT'>
'-> Varibles For Run Time
  Dim C1,Tm1 
'-> Count Up UnComment This Comment Out Count Down
'  C1=0
'-> Count Down Default Fot Hta
  C1=5
'-> Resize And Center Window
  Dim Wth :Wth = int(425)
  Dim Hht :Hht = int(175)
  window.ResizeTo Wth, Hht
  MoveTo ((Screen.Width / 2) - (Wth / 2)),((Screen.Height / 2) - (Hht / 2))
'-> Button 01 Click
   Function Button01()
    If Menu01.style.visibility = "hidden" Then
     Btn01.disabled=True
     Menu01.style.visibility = ""
    ' Text1.innerHTML="Processing Please Wait"
     MyTimer1()
    Else
     Menu01.style.visibility = "hidden"
    End If
   End Function
'-> Timer Function
   Function MyTimer1()
    Select Case C1
'-> Uncomment Case 5 For Count Up And Commnet Case 0 To Stop Count Down    
'     Case 5
     Case 0
      Btn01.disabled=False
      Menu01.style.visibility = "hidden"
'-> Count Up UnComment This Comment Out Count Down
'      C1=0 
'-> Count Down Default Fot Hta
     C1=5  
     Case Else
'-> Count Up UnComment This Comment Out Count Down
'     C1=C1+1
     Text1.innerHTML="Count At : " & C1
'-> Count Down Default Fot Hta
     C1=C1-1
     Tm1=window.setTimeout("MyTimer1()",1000,"VBScript")
    End Select
   End Function
  </SCRIPT>
<BODY>
<!-- Button To Show Menu 01 And Start Timer -->
 <TABLE Style=''><TD>
   <BUTTON ID='Btn01' OnClick='Button01()'> Show Menu </BUTTON>
 </TD></TABLE>
 <!-- Only Seen When Button 01 Click -->
 <DIV ID='Menu01' Class='Menu1'
  Style='visibility:hidden;position:absolute;Top:40pt;Left:89;Width:225;Height:48;'>
  <TABLE Border=1><TD>Some Text Here For Details</TD></TABLE>
  <FONT ID='Text1' Style='Font-Size:9.05pt;Width:125;Height:16;Matgin-Top:3pt;' > </FONT>
 </DIV>  
  </BODY>

Attached File(s)



Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy