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.
This topic is 12 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
hackoo
Posts: 103
Last visit: Tue Apr 26, 2016 9:02 am

Method Popup in HTA didn't work ?

Post 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
This topic is 12 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked