Method Popup in HTA didn't work ?

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
hackoo
Posts: 103
Joined: Sat Jan 22, 2011 12:27 am

Method Popup in HTA didn't work ?

Post by hackoo » Sun Aug 12, 2012 3:26 pm

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

Locked