Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

Method Popup in HTA didn't work ?

$
0
0
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:

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:

<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 ?

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>