VBScript uses Windows Visual Styles

Is it possible to tell VBScript to use Windows Visual Styles so that any form component uses thematic Windows tags, not classic ones? For example, for MsgBox to display a stylized button, rather than a classic three-dimensional square shape.

It:

enter image description here

In contrast to this:

enter image description here

+5
source share
2 answers

In HTA applications, a simple meta tag includes visual styles:

 <META HTTP-EQUIV="MSThemeCompatible" CONTENT="yes"> 

This trick seemed to completely disappear from Google search results, leaving this S / O question at the top!

In the case where VBScript MsgBox is the culprit, it would be necessary to modify the wscript host to use visual styles. But, for the sake of publication, you can easily create your own copy of MsgBox using an HTA file and enable visual styles. I created an exact copy in your screenshot:

msgbox.hta:

 <html> <head> <title>MsgBox Title</title> <META HTTP-EQUIV="MSThemeCompatible" CONTENT="yes"> <HTA:APPLICATION ID="Custom MsgBox" APPLICATIONNAME="Custom MsgBox" BORDER="thin" BORDERSTYLE="normal" CAPTION="yes" CONTEXTMENU="no" ICON="" MAXIMIZEBUTTON="no" MINIMIZEBUTTON="no" SHOWINTASKBAR="no" SINGLEINSTANCE="no" SYSMENU="yes" SCROLL="no" WINDOWSTATE="normal"/> <script language="javascript">window.resizeTo(400,170);</script> </head> <body style="font-family:Arial;padding:20px 0 0 20px;background:rgb(180,240,230)"> <p>MsgBox Body; lorem ipsum dipsum</p><br> <div align="right"><button onclick="window.close()" style="width:80px">OK</button></div> </body> </html> 

This is small enough so you can echo embed it in an hta file directly from the script package if you want.

Hope this helps!

+1
source

You cannot, but if you want to configure other properties of the message box, this may help: http://www.javascriptkit.com/javatutors/vbalert.shtml

0
source

Source: https://habr.com/ru/post/1232822/


All Articles