Page 1 of 1

Method Popup in HTA didn't work ?

Posted: Sun Aug 12, 2012 3:26 pm
by hackoo
Hi

i wonder why the Method Popup didn't work in a HTA, but in Vbscript works!

exemple
: i want to perform a message Box waiting for 7 seconds and it close
by it self if there is no intervention by the User:

VBS

Code: Select all

Sub Popup()
	Dim WshShell, BtnCode
	Set WshShell = WScript.CreateObject("WScript.Shell")
	 
	BtnCode = WshShell.Popup("Comment allez-vous ?", 7, "Répondez à cette Question:", 4 + 32)
	 
	Select Case BtnCode
	   case 6      WScript.Echo "Je suis ravie d'apprendre que vous allez bien."
	   case 7      WScript.Echo "J'espère que vous irez mieux."
	   case -1     WScript.Echo "Y-a-t-il quelqu'un ?"
	End Select
	End Sub
	Call Popup
HTA

Code: Select all

    <html>
       <head>
       <title>Question</title>
       <HTA:APPLICATION
       APPLICATIONNAME="Question"
       SCROLL="yes"
       SINGLEINSTANCE="yes"
       WINDOWSTATE="normal"
       >
       <script language="VBScript">
       Sub Popup()
       Dim WshShell, BtnCode
       Set WshShell = CreateObject("WScript.Shell")
        
       BtnCode = WshShell.Popup("Comment allez-vous ?", 7, "Répondez à cette Question:", 4 + 32)
        
       Select Case BtnCode
          case 6      WScript.Echo "Je suis ravie d'apprendre que vous allez bien."
          case 7      WScript.Echo "J'espère que vous irez mieux."
          case -1     WScript.Echo "Y-a-t-il quelqu'un ?"
       End Select
       End Sub
       </script>
       </head>
       <body>
       <input type="button" value="Question" name="run_button"  onClick="Popup"><p>
       </body>
       </html>
So in HTA the message Box freezes and don't close by it self why ?


hackoo2012-08-12 22:28:58